ko**********@gmail.com wrote:
Hello,
Does anyone know of how I can go about suppressing a mouse click after
I've handled it? I know this can be done for keystrokes via the
Handled property, but I am unable to find a way to do so for mouse
events.
try this
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if (m.Msg == 0x202) /* WM_LBUTTONUP */
{
// Handle the mouse Event here
m.Result = new IntPtr(1); // Sucessful
return; //eat up the message
}
base.WndProc(ref m);
}
override the WndProc function of the control whose click you want to
supress (by overriding that control)
Alternatively capture the WM_NOTIFY message and check if its left
button click and if its on the control that you want to handle.
But is a little bit complex and I dont remember right now how exactly
to do this.
code goes something like this.
if(m.Msg == WM_NOTIFY)
{
NMHEADER = get this thing from m.LParam
then the NMHEADER structure has all the information required to know
what type of notification message is it and which control is it meant
for.
}
for a list on the constant values for the Windows Messages refer this
link
http://www.autohotkey.com/docs/misc/SendMessageList.htm
Searching on google might help.
Sorry for the incomplete solution.