eagIe

I would like to capture the mouse's left click event and convert it to a right-click.

A few examples of utilities that implement this, are: DialKeys (for the UMPC), Fujitsu made a utility for the P1510D Notebook/Tablet PC, and Samsung also implemented this for the Q1 in their "TouchMon" utility. The reason I am looking for a solution like this is that in a UMPC there is no easy way to right-click.

I am looking for a utility which I can run (.exe) which will then convert my next mouse click into a right-click. After performing the right-click, the mouse should function normally.

I am familiar with programming and .net so if someone provides me with sample code I would be able to create this utility myself.

Thank you very much.


Re: .NET Base Class Library Mouse Related functions in Windows XP

Alan Robbins

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






Re: .NET Base Class Library Mouse Related functions in Windows XP

nobugz

Nope, won't work. The only global hooks that you can write with a .NET app are WH_MOUSE_LL and WH_KEYBOARD_LL. Those hooks won't let you change the generated Windows message. WH_MSGFILTER might be able to do this (not clear from the docs) but that requires a C++ DLL. If you just want to fix the mouse messages in your own app, you have a shot.