Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hooking Troubles

Status
Not open for further replies.

Brent113

Programmer
Aug 13, 2003
67
US
I am using a JournalRecord hook to monitor the keyboard and mouse, and a GetMessage hook to monitor if that hook gets removed with ctrl-esc or ctrl-alt-del so I can reinstall it. Everything works great except:

Small problem: hit the volume key on the keyboard and the entire system freezes, and you have to use some clever ctrl-alt-deleting to close the program. The mouse and keyboard are unresponsive until you "refresh" with a ctrl-alt-del or ctrl-esc.

Any ideas as to what might cause this or how I can prevent this from happening?

____________________________________________________________________________
There are only 10 types of people in the world. Those that know binary and those that don't

Brent
 
Difficult to say without seeing some of you code.

BTW, I'm not sure why you need the GetMessage hook
 
You do need the getmessage hook or there is no way of detecting if the journal gets removed. If you'd like me to paste the code, I can, but it's nothing special, just standard hook code

____________________________________________________________________________
There are only 10 types of people in the world. Those that know binary and those that don't

Brent
 
I've actually used this same code in other programs just fine. The procedure it's in is kind of long, I wonder if that could have anything to do with it. But why only the volume keys?

____________________________________________________________________________
There are only 10 types of people in the world. Those that know binary and those that don't

Brent
 
>there is no way of detecting if the journal gets removed

Fair enough, although I think I'd probably try subclassing the top-level window rather than putting in another hook. But I guess that's just splitting hairs.
 
I guess for the record I'll state the workaround I used, and it works, becuase it uses equivalent functions.

Instead of using the JournalRecord hook with a GetMessage, I used a Keyboard and a Mouse hook separately. I had to change the code a smidge, but now it doesn't kill windows :)

____________________________________________________________________________
There are only 10 types of people in the world. Those that know binary and those that don't

Brent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top