Red Gate forums :: View topic - cancel mouse click on a control
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
PInvoke.Net
PInvoke.Net forum

cancel mouse click on a control

Search in PInvoke.Net forum
Post new topic   Reply to topic
Jump to:  
Author Message
Robskew



Joined: 02 Sep 2008
Posts: 1

PostPosted: Tue Sep 02, 2008 10:13 am    Post subject: cancel mouse click on a control Reply with quote

Hi everybody,

i'm creating an application using an external liberay that creates a control.If you click on this control it reacts on the mouse click, but i want to cancel this. I want to implement my own mouse click event for that control and cancel the click message to the control. Problem is that the control receives the mouse click event as first.
I tries to use wndproc to implement my own code but still the control receive the click first.

Can this be done by using a hook?
How do i implement this and then cancel the mouse event before it reaches the control??

Thnx
Back to top
View user's profile Send private message
Robert



Joined: 30 Oct 2006
Posts: 428
Location: Cambridge, UK

PostPosted: Tue Sep 02, 2008 10:55 am    Post subject: Reply with quote

Now, this is without having tried doing this at all, so I might be talking complete rubbish Smile.

However, what you could try doing is to subclass the window handle of the control in question (see http://tinyurl.com/6m8g37), then intercept the click messages, passing any other messages on to the original WndProc (http://tinyurl.com/6ap5lr).

Hopefully that makes sense!

Cheers,
Rob
_________________
Robert Chipperfield
Developer, Red Gate Software Ltd
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group