473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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


May 5 '06 #1
3 6068
"Glenn Palomar" <gl***********@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/>

May 6 '06 #2
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]" <hi***************@gmx.at> wrote in message
news:Of**************@TK2MSFTNGP04.phx.gbl...
"Glenn Palomar" <gl***********@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/>

May 8 '06 #3
"Glenn Palomar" <gl***********@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/>

May 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael J Whitmore | last post by:
Greetings, I have a very simple question. How do you simulate a user input to turn off a screen saver in Windows (either a mouse movement, mouse click, or keyboard input)? I promise I searched...
4
by: johnny | last post by:
On a form I would like to simulate a button click when the Enter is pressed. My form is setup and it works if the delegate for the key pressed on the form calls the delegate for the button pressed....
2
by: sandro72 | last post by:
hi, i need to simulate the right mouse click and choose an option. i want to use (in .net) the option "print" that appear when i right-click on ..doc file and be able to change the printer before...
3
by: Ryan Liu | last post by:
Can someone give a sample to prevent a row from being deleted in a datatable? I tried e.Row.RejectChanges(); in dt_RowDeleting() but seems does not work. I need verify if there other data...
3
by: madhuri.eerupula | last post by:
Hi. How to simulate(automatic) mouse movements and click operation using c#. Actually, i got pixels in the face (face tracking) right now and i need to move mouse(automatically, without using...
4
by: Abhishek | last post by:
Hi, I have a activex web browser embedded in a windows form and on a click of a form button i need the mouse to go the position for example 100, 100 and click the link that will be there on that...
3
by: John Dalberg | last post by:
I have an app that keeps popping up a windows with a 'Yes' or 'OK' button on it. I am trying to write a little app that automates hitting the enter key so I don't have to do it myself. I used...
4
by: flplini | last post by:
I want to ask how to use C++ to simulate the mouse control? ex:Let the mouse double-click the left key functions,thanks!
18
by: eliss.carmine | last post by:
Is it possible to simulate a mouse click in the window I made (it's a Form), but not give it focus? I tried using WinAPI's mouseevent and SendMessage of WM_LBUTTONDOWN/WM_LBUTTONUP as suggested...
5
by: nuhfeken | last post by:
We have a C# winform that uses the MVP design pattern for the user interface. For reasons I'd rather not explain we need to simulate a right mouse click on a specific control to deactivate the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.