问题
I would like to Monitor the creation of windows (HWND) in C.
I'd like to know if there's some kind of event that the WINAPI provides to handle the creation of a window.
回答1:
If you are concerned only with top-level windows, you can use SetWindowHookEx to register a ShellProc and watch for HSHELL_WINDOWCREATED
. If you need notification of the creation of any window, you can use a CallWndProc and watch for WM_CREATE
messages.
来源:https://stackoverflow.com/questions/7019523/monitor-creation-of-a-window-hwnd