How to simulate mouse click in vb.net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Glenn Palomar

    #1

    How to simulate mouse click in vb.net

    Hi,

    Instead of using user32 API for simulating mouse click (left down, left up,
    etc.), are there any .net function/class that i can use?
    Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Int32, ByVal
    dx As Int32, ByVal dy As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo
    As Int32)

    Thanks,

    Glenn




  • Herfried K. Wagner [MVP]

    #2
    Re: How to simulate mouse click in vb.net

    "Glenn Palomar" <glenn.palomar@ autodesk.com> schrieb:[color=blue]
    > Instead of using user32 API for simulating mouse click (left down, left
    > up, etc.), are there any .net function/class that i can use?[/color]

    No.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>

    Comment

    • Glenn Palomar

      #3
      Re: How to simulate mouse click in vb.net

      Thanks.

      How about keboard events? Is there another way of simulating keyboard events
      in .net without using keybd_event user32 API.

      If none, is this declaration correct?

      Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan
      As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

      Thanks,
      Glenn

      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:OfrgjBKcGH A.3872@TK2MSFTN GP04.phx.gbl...[color=blue]
      > "Glenn Palomar" <glenn.palomar@ autodesk.com> schrieb:[color=green]
      >> Instead of using user32 API for simulating mouse click (left down, left
      >> up, etc.), are there any .net function/class that i can use?[/color]
      >
      > No.
      >
      > --
      > M S Herfried K. Wagner
      > M V P <URL:http://dotnet.mvps.org/>
      > V B <URL:http://classicvb.org/petition/>[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: How to simulate mouse click in vb.net

        "Glenn Palomar" <glenn.palomar@ autodesk.com> schrieb:[color=blue]
        > How about keboard events? Is there another way of simulating keyboard
        > events in .net without using keybd_event user32 API.[/color]

        'SendKeys.Send' .
        [color=blue]
        > If none, is this declaration correct?
        >
        > Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal
        > bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)[/color]

        No, it's incorrect. Change 'As Long' to 'As Int32'.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://classicvb.org/petition/>

        Comment

        Working...