473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simulate Mouse Click

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 position.
i am usind the win api setcursonpos to set the mouse position

assume that the link will always be there at 100, 100. how do i get Windows
to create the click event.

i tried using
SendMessage(axWebBrowser1.Handle,WM_LBUTTONDOWN,0, 0);
SendMessage(axWebBrowser1.Handle,WM_LBUTTONUP,0,0) ;

but this is not happening.

any ideas pls.

regards
Abhishek
Jul 22 '06 #1
4 5470
If the link you mentioned is for example a linklabel(or any component) and
you've handled it's OnClick event, it's easy. I assume this, and name the
component as link1, you can simply call link1_OnClick(null, null);

hope this helps
--
cheers
farshad

Jul 23 '06 #2
Hi,

well the browser can go to any webpage to i cant use this. Need to
simulate a proper click on a location.

Regards
Abhishek

"farshad.A" <fa******@discussions.microsoft.comwrote in message
news:84**********************************@microsof t.com...
If the link you mentioned is for example a linklabel(or any component) and
you've handled it's OnClick event, it's easy. I assume this, and name the
component as link1, you can simply call link1_OnClick(null, null);

hope this helps
--
cheers
farshad

Jul 24 '06 #3
Well, you've to get the DOM Document of the the HTML page from the
embedded ActiveX control, and simulate the mouse click using the
javascript. This has also to be done by implementing those interfaces
that IE provides. (I cannot remember their names at the moment).

HTH,
Mehdi

Abhishek wrote:
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 position.
i am usind the win api setcursonpos to set the mouse position

assume that the link will always be there at 100, 100. how do i get Windows
to create the click event.

i tried using
SendMessage(axWebBrowser1.Handle,WM_LBUTTONDOWN,0, 0);
SendMessage(axWebBrowser1.Handle,WM_LBUTTONUP,0,0) ;

but this is not happening.

any ideas pls.

regards
Abhishek
Jul 24 '06 #4
I got the mouse_event function working. my only problem is that i cant pass
the handle of the application with this.
is there any way to pass the handle of the browser with mouse_event to that
the click happens in that application.

"mehdi_mousavi" <me***********@gmail.comwrote in message
news:11*********************@i3g2000cwc.googlegrou ps.com...
Well, you've to get the DOM Document of the the HTML page from the
embedded ActiveX control, and simulate the mouse click using the
javascript. This has also to be done by implementing those interfaces
that IE provides. (I cannot remember their names at the moment).

HTH,
Mehdi

Abhishek wrote:
>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 position.
i am usind the win api setcursonpos to set the mouse position

assume that the link will always be there at 100, 100. how do i get
Windows
to create the click event.

i tried using
SendMessage(axWebBrowser1.Handle,WM_LBUTTONDOWN,0 ,0);
SendMessage(axWebBrowser1.Handle,WM_LBUTTONUP,0,0 );

but this is not happening.

any ideas pls.

regards
Abhishek

Jul 24 '06 #5

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

Similar topics

1
12210
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
5155
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
1759
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
2276
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
34721
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...
3
29813
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
7491
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
22042
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
30531
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
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.