Reputation: 529
The user32.dll provides functions to get the process id from a process executable name, and I can also obtain the active or foreground window that the user is working.
Can I determine what windows the targeted process has opened? Otherwise, can I find out what details about the process that opened the foreground/active window?
My code needs to run only when another specific process is running and the user is actively using that window, while that window is the active, foreground, and currently focused window on the desktop.
Upvotes: 2
Views: 1157
Reputation: 34218
I think you want to use GetWindowThreadProcessId or possibly EnumThreadWindows
Upvotes: 2