473,322 Members | 1,493 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.

Simulate mouse clicks and keyboard input

I have a C# application that hosts an AxWebBrowser control which I automate
by sending mouse clicks and keyboard input. I have had various problems in
doing this due to a bug in the AxWebBrowser receiving input when it is
hosting a flash page however I have got it to work using SendKeys for the
keyboard input and the Windows API SendInput function for the mouse clicks
(along with Cursor.Position) however I'd like to do this in the background
either ideally when the window is out of focus, minimized or even hidden
window or at the least so the user can carry on working on the machine and
the mouse isn't captured.

Note: I've played around using mouse_event and even SendMessage but the
flash bug always got in the way and the page didn't receive the click.

Any ideas would be gratefully received.

Thanks,

Simon
Feb 25 '08 #1
3 8370

"progger" <Si*********@newsgroup.nospamwrote in message
news:84**********************************@microsof t.com...
I have a C# application that hosts an AxWebBrowser control which I
automate
by sending mouse clicks and keyboard input. I have had various problems in
doing this due to a bug in the AxWebBrowser receiving input when it is
hosting a flash page however I have got it to work using SendKeys for the
keyboard input and the Windows API SendInput function for the mouse clicks
(along with Cursor.Position) however I'd like to do this in the background
either ideally when the window is out of focus, minimized or even hidden
window or at the least so the user can carry on working on the machine and
the mouse isn't captured.

I don't believe you can send input to a control in this manor if it does not
have the focus. SendKeys (and the such) is supposed to replicate user input
device data, and you can't input data to something that the cursor (or
pointer) isn't on.

I have an idea of how to possibly do it in the background, but just thinking
about it makes me tremble and quiver.

>
Note: I've played around using mouse_event and even SendMessage but the
flash bug always got in the way and the page didn't receive the click.

Could this possibly be due to timing issues? Something like what is
mentioned here:

http://msdn2.microsoft.com/en-us/library/ms171548.aspx

I enjoy problems like these, they are my favorite kind to work out.
--
Roger Frost
"Logic Is Syntax Independent"

Feb 25 '08 #2
Hello,

I'm not sure to understand you because my poor english...

If you want to simulate a key press or mouse click, look forward to
UIAutomation API in framework 3.0 and 3.5.

look this links:

http://channel9.msdn.com/Showpost.aspx?postid=231217

http://blogs.msdn.com/abhinaba/archi...27/648221.aspx

bye.
Feb 25 '08 #3
Many thanks for the response however unfortunately the AxWebBrowser control
doesn't have a OnMouseClick event to call. My ideal scenario would be to
somehow create a 'virtual' window for collecting the data and then displaying
the result in a 'real' window.

Thanks,

Simon
Feb 25 '08 #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...
3
by: Per Larsson | last post by:
Hi! I've developed an application, and I want to use a semi opac form to show the help. The idea is to show the transparent help form on top (TopMost = True)and still be able to work with the...
0
by: Mythran | last post by:
I'm trying to create a library that will 1.) Simulate an input device (IE: keyboard, mouse, joystick) and 2.) Capture data sent from an input device (IE: keyboard, mouse, joystick). The reason's...
2
by: kumar_subrahmanya | last post by:
Hi, I am facing problems in sending mouse clicks via SendInput API. Mouse clicks are being sent but at the X,Y co-ordinates. I am mapping my monitor to the (0,0,65535,65535) virtual monitor as...
16
by: dfaber | last post by:
Hi all, I have been searching for a keyboard and mouse tracker on linux. I've read solutions (watch at sourceforge) which look at /proc/interrupts to check keyboard or mouse activity. I also read...
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...
0
by: ludwig.frank | last post by:
Hi, I am attempting to detect mouse clicks from within curses, using "select" on sys.stdin. It is working great within an xterm under X, but not very well in a "real" linux console. When I click...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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.