开发者

Unable to retrieve title of just created window

开发者 https://www.devze.com 2023-03-28 18:20 出处:网络
I\'m trying to retrieve the title of a window when my hook procedure receive an HCBT_ACTIVATE message.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消