Unable to retrieve title of just created window
I'm trying to retrieve the title of a window when my hook procedure receive an HCBT_ACTIVATE message.
The problem is that when this message is received for the first time the window seems not to have the caption already set. I think I should maybe add some kind of delay to the call to GetWindow开发者_JAVA百科Text
?
(After the window is created and, for example, I receive a HCBT_MOVESIZE or HCBT_DESTROYWND message I can get the correct title)
You should set the hook with SetWindowHookEx, using WH_CALLWNDPROCRET to receive the WM_CREATE notification after the message has been processed.
精彩评论