Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / March 2008



Tip: Looking for answers? Try searching our database.

SendInput

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dean C - 25 Mar 2008 18:11 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
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.