To implement the functionality you are looking for you'll need to implement a "Hook" proc to catch the mouse click. Try googling for information on the following Win32 API's:
[ DllImport("user32.dll")]private static extern IntPtr SetWindowsHookEx(HookType code, HookProc func, int hInstance, int threadID);
[ DllImport("user32.dll")]private static extern int UnhookWindowsHookEx(IntPtr hhook);
[ DllImport("user32.dll")]private static extern int CallNextHookEx(IntPtr hhook, int code, int wParam, IntPtr lParam);
You can hook the keyboard or the mouse. If you're familiar with WndProc routines in Windows forms, think of the HookProc as a system wide message filter.
HTH
|