I'm lost. I code by following examples, but I can't find the right example.
All that I want to do is send Shift+left mouse button. MS Project has a
function That I want to use that can only be accessed using shift-click.
Sendkeys does not work with the mouse.
I learned that for XP the correct function is Sendinput, but it seems like
all the structured input is making a mountain out of a molehill. Is there a
simple way to send a shift-click or do I need to unscramble the guidance
below?
vbKeyShift
MOUSEEVENTF_LEFTDOWN
MOUSEEVENTF_LEFTUP
typedef struct tagKEYBDINPUT {
WORD wVk;
WORD wScan;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KEYBDINPUT, *PKEYBDINPUT;
typedef struct tagINPUT {
DWORD type;
union {MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
};
}INPUT, *PINPUT;
UINT SendInput( UINT nInputs,
LPINPUT pInputs,
int cbSize
);
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT, *PMOUSEINPUT;
Stuart McCall - 25 Mar 2008 18:38 GMT
> I'm lost. I code by following examples, but I can't find the right
> example.
[quoted text clipped - 39 lines]
> ULONG_PTR dwExtraInfo;
> } MOUSEINPUT, *PMOUSEINPUT;
Take a look here:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=47634&lngWId=1
That should get you on track.
Karl E. Peterson - 25 Mar 2008 22:54 GMT
> I'm lost. I code by following examples, but I can't find the right example.
> All that I want to do is send Shift+left mouse button. MS Project has a
[quoted text clipped - 5 lines]
> simple way to send a shift-click or do I need to unscramble the guidance
> below?
Two samples you might find useful:
http://vb.mvps.org/samples/MouseEvent
http://vb.mvps.org/samples/SendInput

Signature
.NET: It's About Trust!
http://vfred.mvps.org