I know how to programically press the left and right mouse butons, but can any one tell me how to press the middle button and scroll both vertically and horizantally.
Ideally I just need the UInt32 for the 5 functions scroll up, down, left, right, and middle mouse button press.
This is what I have so far:
const UInt32 MouseEventLeftDown = 0x0002;
const UInt32 MouseEventLeftUp = 0x0004;
const UInt32 MouseEventRightDown = 0x0008;
const UInt32 MouseEventRightUp = 0x0010;
public static void rClick()
{mouse_event(MouseEventRightDown, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventRightUp, 0, 0, 0, new System.IntPtr());
}
public static void Click()
{mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftDown, 0, 0, 0, new System.IntPtr());
mouse_event(MouseEventLeftUp, 0, 0, 0, new System.IntPtr());
}
Thank you for any help.
Mike GoldPosted Feb 8, 2008, 6:17 PM
http://msdn2.microsoft.com/en-us/library/ms646260(VS.85).aspx
or you can use SendInput
http://msdn2.microsoft.com/en-us/library/ms646310(VS.85).aspx
also see how to pinvoke it:
http://www.pinvoke.net/default.aspx/user32/SendInput.html