How can I tell if another process has the active foreground window? (Win32 API vb.net)
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 i开发者_JAVA技巧s 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.
I think you want to use GetWindowThreadProcessId or possibly EnumThreadWindows
精彩评论