I need to run a 3rd party application and not have it generate any visible windows. As such, I run it on a separate desktop by first calling CreateDesktop then passing the desktop name to CreateProcess as demonstrated here . That works fine, and the process runs happily on that other desktop.
Now I'd like to control it using my application. Normally I just use EnumWindows
to get the top level windows, followed by EnumChildWindows
to get individual components.
But since it's on another desktop, I use EnumDesktopWindows
to get the top level windows. That works fine. But when I try to pass those handles to EnumChildWindows
, I get nothing.
Is there a way to get child windows from a process that's running on another Desktop?
Worked it out. EnumChildWindows
works fine even for windows running another Desktop.
I was accidently comparing a PID to a Window Handle in the callback.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.