Link to home
Start Free TrialLog in
Avatar of Brainwashed2
Brainwashed2Flag for Germany

asked on

How can i deny a hooked key to delete selected text ?

Hi experts!
I have a dokument with selected text. With my app I want to copy this text to path 'C:\A'  by pressing 'a' or 'A'
and/or to path 'D:\B' by pressing key 'B'. Hooking is not the problem, but how can I avoid to replace the selected
text with my keystroke ?

Regards, Brainwashed2
ASKER CERTIFIED SOLUTION
Avatar of 2266180
2266180
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you're using keyboard hook (i.e., WH_KEYBOARD), you may use nonzero value as a result to block it. Here's a quote from MSDN:
"If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the rest of the hook chain or the target window procedure."
Avatar of Brainwashed2

ASKER

Thanks ! You opened my eyes :-)