i was wondering wether it is possible to hold down shift while clicking with the mouse.
It would look simmilar to this: – If you could simulate a mouse click with the SendKeys.SendWait function – SendKeys.SendWait(+{Mouseclick});
So far I have called the API “User32.dll” to call the mouse click:
public const int MOUSEEVENTF_LEFTDOWN = 0x2;
public const int MOUSEEVENTF_LEFTUP = 0x4;
public const int MOUSEEVENTF_MIDDLEDOWN = 0x20;
public const int MOUSEEVENTF_MIDDLEUP = 0x40;
public const int MOUSEEVENTF_RIGHTDOWN = 0x8;
public const int MOUSEEVENTF_RIGHTUP = 0x10;
[DllImport("User32.dll")]
public static extern int mouse_event(int dwFlags, int dx, int dy, int cButton, int dwExtra);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
However; is it possible to hold the Shift key down at the same time?
Regards, DotTutorials
You should be able to use the
keybd_eventfunction to simulate the Shift key. Something like: