Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello! I was wondering what would happen if I had two different applications with global hooks "listening" for the same events(let's say for a key press) and both of them were programmed to cancel the event and then show a message?

Would both of the show the message or only one? If so why?

P.S. I would do this experiment myself but i can't and since my curiosity is killing me I thought to ask here.
Posted

1 solution

From MSDN[^]:

The action a hook procedure can take depends on the type of hook involved. The hook procedures for some types of hooks can only monitor messages; others can modify messages or stop their progress through the chain, preventing them from reaching the next hook procedure or the destination window.

Hence, I suppose (like you, I have not tested it) that only the first hook procedure intercepting the event would show the message.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900