BugFix Posted February 6, 2024 Posted February 6, 2024 (edited) I monitor an external window for resizing with the WinGetPos() function. This allows me to detect every move, minimize, maximize, restore and resize. One problem, however, is the SplitScreen dialog in Windows 11. If the size or position of the window is changed via this dialog, no associated event is usually triggered or it is not recognizable. This is clearly visible in the example script if the position of the window is frequently changed via the split dialog. #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> Global $hGui = GUICreate('Test', 300, 200, -1, -1, BitOR($WS_MINIMIZEBOX,$WS_CAPTION,$WS_POPUP,$WS_MAXIMIZEBOX,$WS_SIZEBOX)) GUISetState() _ConsoleWriteSize('START') While True Switch GUIGetMsg() Case -3 Exit Case $GUI_EVENT_MINIMIZE _ConsoleWriteSize('GUI_EVENT_MINIMIZE') Case $GUI_EVENT_RESTORE _ConsoleWriteSize('GUI_EVENT_RESTORE') Case $GUI_EVENT_MAXIMIZE _ConsoleWriteSize('GUI_EVENT_MAXIMIZE') Case $GUI_EVENT_RESIZED _ConsoleWriteSize('GUI_EVENT_RESIZED') Case $GUI_EVENT_PRIMARYUP _ConsoleWriteSize('SPLIT SCREEN DIALOG') EndSwitch WEnd Func _ConsoleWriteSize($_sMsg) Local Static $n = 0 $n += 1 Local $aWnd = WinGetPos($hGui) ConsoleWrite(StringFormat('[%s] %d, %d, %d, %d\t%s', $n, $aWnd[0], $aWnd[1], $aWnd[2], $aWnd[3], $_sMsg) & @CRLF) EndFunc What options do I have to react to the split dialog? I have tried to intercept the events with SHELLHOOK, but this only seems to work with self-created windows. EDIT: SHELLHOOK works, but does not recognize the window handle. I get the following information when the split screen dialog was used: $HSHELL_RUDEAPPACTIVATED: PID: -1 ClassName: hWnd: 0x00000000 Edited February 6, 2024 by BugFix Best Regards BugFix
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now