VBA or sendkeys - mouse move and click


J

Jane

Hello everyone

I hope you can help me with this.

I have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
The amount of move is not that important as long as it's around 2 inches or
so to the left or right, up, or down (basically out of the small Find/Search
window)

I have looked using SendKeys - something like:
{mousemove X,Y}
{mouseclick}
Of course this will not work in VBA but is the something like this available ?

I can use SendKeys Alt-Tab to show the windows panel but then you still have
to use the mouse to click the window you want

I can't use the actual mouse so it all has to be done programmatically

Thank you if you can offer any assistance

Jane
 
Ad

Advertisements

S

Stefan Hoffmann

hi Jane,

I have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
Why do you want to simulate it? Is 'simulation' the correct term? If the
answer is yes then you need to use Win32 API functions, e.g.

GetWindow to find the correct IE window:

http://support.microsoft.com/kb/183009

SendMessage to send any message (this includes the mouse messages) to it:

http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx

Otherwise you should explain, what you are trying to achieve.


mfG
--> stefan <--
 
Last edited by a moderator:
Ad

Advertisements

Joined
Feb 28, 2016
Messages
1
Reaction score
0
have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
The amount of move is not that important as long as it's around 2 inches or
so to the left or right, up, or down (basically out of the small Find/Search
window)

if you don't find the solution within VBA or Access don't waste any more time, this will work (guaranteed):
AutoHotkey
https://autohotkey.com/download/

a few sample commands:
mouseclick, left, Xcoordinate, Ycoordinate, NumberOfClicks
mousemove Xcoordinate, Ycoordinate
send {RIGHT,HOME, TAB, DELETE, ETC}
msgbox
SoundBeep
and many more...
to shift back and forth between applicatios use ALT+TAB send !{tab}
don´t forget to use "AutoIt3 Window Spy" (included with AutoHotkey)
best of luck!
 

Attachments

  • sample file open with notepad.ahk.txt
    4.8 KB · Views: 287

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top