cancel mouse click on a control

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Robert

cancel mouse click on a control

Postby Robskew » Tue Sep 02, 2008 10:13 am

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
Robskew
 
Posts: 1
Joined: Tue Sep 02, 2008 10:11 am

Postby Robert » Tue Sep 02, 2008 10:55 am

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

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
Red Gate
Robert
 
Posts: 410
Joined: Mon Oct 30, 2006 11:15 am
Location: Cambridge, UK


Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests