GetForegroundWindow
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to……
[/Quote]
这个方法貌似行不通。父窗口里面有多个子窗口,有些子窗口可能覆盖在一起,有些不是。
我找到一点规律,多个子窗口覆盖在一起时,点击时选中的是 后创建的窗口,而不是最上面的那个窗口。
GetForegroundWindow
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
HWND GetForegroundWindow(VOID);
Parameters
This function has no parameters.