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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable Ctrl key , an hook question ?

Status
Not open for further replies.

thangnguyen

Programmer
May 28, 2001
11
VN
Hi,
I use hook to receive message sent to application A.when user holds Ctrl down and left-clicks on application A, I can receive this action with hook, but I don't know how to modify the message so that only left-click action was notified to app A.
I have tried to modify the wParam = MK_LBUTTON only, but it seems that when this message come to A, user is still holding Ctrl key, so A can aware of this full action with holding Ctrl key.
And the way I think is to disable Ctrl key before send message to A, and enable it later.
Do you have any suggestion ???

thank you so much,
Thang.
 
you should handle MW_KEYDOWN. John Fill
1c.bmp


ivfmd@mail.md
 
thanks for the info,
I have tried it but it doens't work. Is seems that at the moment app A is getting the message WM_LBUTTONDOWN, it gets the state of Ctrl key ( from function like GetAsyncKeyState ).
So even if I have prevent message indicating the pressed state of Ctrl key, app A still get the correct state. So my choice is not much, the solution may be still as I though : disabling the Ctrl key. But I still don't know how ..:(...

thanks,

Thang.
 
just return without any actions if ctrl is pressed, and process message if not. John Fill
1c.bmp


ivfmd@mail.md
 
I don't understand exactly what you mean, all I have is from hook, I don't know what app A does with those messages, the only thing I could do is within my hookproc : prevent from sending to app A any message may include the state of Ctrl key : WM_LBUTTONDOWN with Ctrl key down, WM_KEYDOWN with Ctrl key down.
But it still doenst work at all !!!

Thang.
 
What do you mean app A? If you have some window, try do do subclassing. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top