Archived

This topic is now archived and is closed to further replies.

Loss hook when dialog program is inactive.

This topic is 5583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a dialog program and it use keyboard hook, but if the dialog is hide or inactive, it will not receive hook message. Why? I want recevie keyboard hook message any time( my program active or inactive, hide or show ). Thank you.

Share this post


Link to post
Share on other sites
Interesting. When a dialog is hidden it loses focus - this is controlled by the "enable" functions - a terminology variance which seems somewhat at odds with itself. There are several messages associated with gaining and losing focus - I don''t recall them all off the top of my head. My suggestion is to use the Spy++ tool to trace the messages being sent to your app, specifically those preceeding the point at which your keyboard hook fades out and from there investigate each of those messages to determine how they influence other messages and how they might be blocking your hook.

Another possiblity - a dialog proc returns BOOL instead of LRESULT the way that ordinary wnd procs do. Perhaps the descrepancy is effecting your hook in some way.

Share this post


Link to post
Share on other sites