Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
i want to capture all mouse click event anywhere in the windows [means global mouse events] and suppress its action.
using following code i can suppress the mouse click events in my application's form only not outside of the my app form :
C#
protected override void WndProc(ref Message m)
{
    if (m.Msg == (int)MouseMessages.WM_LBUTTONDOWN || m.Msg == (int)MouseMessages.WM_LBUTTONUP)
        MessageBox.Show("Click event caught!");  //return; --to suppress the mouse click
    else
        base.WndProc(ref m);
}

Please can anyone tell me how can i achieve this?
Posted
Comments
BillWoodruff 3-Oct-13 9:38am    
I'm trying to imagine why you might want to disable all Click Events in other running processes. Are you simulating a cyber-warfare assault ?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900