I want to hook to the resizing and/or position change of TrayNotifyWnd
I am utilizing what I found here:
How to use winapi SetWinEventHook in python?
Now I do realize that this captures events from all instances, instead of just the ones in the taskbar or to be more precise just TrayNotifyWnd
, however it should fire also when window elements inside Shell_TrayWnd
like TrayNotifyWnd
are resized ???
EVENT_SYSTEM_MOVESIZEEND= 0x000B
user32.SetWinEventHook.restype = ctypes.wintypes.HANDLE
hook = user32.SetWinEventHook(
EVENT_SYSTEM_MOVESIZEEND,
EVENT_SYSTEM_MOVESIZEEND,
0,
WinEventProc,
0,
0,
WINEVENT_OUTOFCONTEXT
)
It does fire on every window being resized, but not TrayNotifyWnd.
I've been testing this by manually resizing TrayNotifyWnd with win32gui.SetWindowPos, hook does not trigger
Windows 11, Python 3.10.7