I used _WinAPI_SetParent to embed some programs into a AutoIt GUI . Then I found I can’t detect those program windows anymore, only their parent ( = AutoIt GUI) can be detect. I use ShellHook and it tell me that the program windows are destroyed. Furthermore, ShellHook can’t no long detect these program windows neither.
So how to monitor these program windows activities that embedd into a AutoIt GUI, like one can use WinExists, WinActive and send commands to them, like WinActivate, WinGetHandle. Or using ShellHook to do this?
This function use DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hWndChild, "hwnd", $hWndParent)
Once embedded, the windows become controls. As a result, try using the
Control*functions. For example you’d useControlFocusto replaceWinActivate,ControlGetHandleto replaceWinGetHandle.Also, keep the handle and then some windows functions will still work on them. The only difference between windows and controls is that one has a parent window.