Question

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)

Was it helpful?

Solution

Once embedded, the windows become controls. As a result, try using the Control* functions. For example you'd use ControlFocus to replace WinActivate, ControlGetHandle to replace WinGetHandle.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top