CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Windows NT mouse click

    I need to know how to make the left mouse button click in Windows NT. I've tried mouse_event which works fine for me in Win95. The VB documents say that it was superseded and now you have to use SendInput instead. Anyone know how to do this or another way to send a mouse click in NT?

    Thanks


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Windows NT mouse click

    I found this on planet-source. It works in NT 4

    public Declare Sub mouse_event Lib "user32" (byval dwFlags as Long, byval dx as Long, byval dy as Long, byval cButtons as Long, byval dwExtraInfo as Long)
    public Const MOUSEEVENTF_LEFTDOWN = &H2
    public Const MOUSEEVENTF_LEFTUP = &H4
    public Const MOUSEEVENTF_MIDDLEDOWN = &H20
    public Const MOUSEEVENTF_MIDDLEUP = &H40
    public Const MOUSEEVENTF_RIGHTDOWN = &H8
    public Const MOUSEEVENTF_RIGHTUP = &H10
    public Const MOUSEEVENTF_MOVE = &H1
    public Sub LeftClick()
    LeftDown
    LeftUp
    End Sub
    public Sub LeftDown()
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    End Sub
    public Sub LeftUp()
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    End Sub



    Original author is Arthur Chaparyan


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured