Home All Groups Group Topic Archive Search About

How to simulate mouse click in vb.net

Author
5 May 2006 11:43 PM
Glenn Palomar
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

Author
6 May 2006 12:02 AM
Herfried K. Wagner [MVP]
"Glenn Palomar" <glenn.palo***@autodesk.com> schrieb:
> Instead of using user32 API for simulating mouse click (left down, left
> up, etc.), are there any .net function/class that i can use?

No.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
8 May 2006 4:16 PM
Glenn Palomar
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

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:OfrgjBKcGHA.3872@TK2MSFTNGP04.phx.gbl...
> "Glenn Palomar" <glenn.palo***@autodesk.com> schrieb:
>> Instead of using user32 API for simulating mouse click (left down, left
>> up, etc.), are there any .net function/class that i can use?
>
> No.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
8 May 2006 4:23 PM
Herfried K. Wagner [MVP]
"Glenn Palomar" <glenn.palo***@autodesk.com> schrieb:
> How about keboard events? Is there another way of simulating keyboard
> events in .net without using keybd_event user32 API.

'SendKeys.Send'.

> 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)

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/>