Jump to content

how to move the mouse in a certain window


Recommended Posts

Look at MouseMove ( x, y [, speed] ) function and Opt('MouseCoordMode') and WinGetPos()

If your window is active then use Opt('MouseCoordMode') = 0 --> relative coords to the active window

You may get pos oof your window and use MouseMove with position of window + relative position

Unless i've misunderstood it that function is no good to me because it does not allow me to specify which window I want to send mouse movement to. I have tried using mousemove but when i click off the window and it looses focus the mouse movements are disrupted.

Please advise.

TIA.

Edited by indigoblue
Link to comment
Share on other sites

Sorry.

I'll try to explain fuller - please accept apologies if i have been too vague.

I run five instances of the same program. The programs run on the desktop and are arranged so i can see them all at the same time, but obviously only one of them can have focus.

I have a seperate macro for each of the five instances which i need to run at the same time. So the problem isn't that I don't know how to make a window have focus. It is that at any one time there will be at least four windows that don't have focus that I want a macro to be running in.

I hope that has made it clearer.

TIA for any further advice.

Link to comment
Share on other sites

You need a single script to act as a dispatcher, timesharing between the instances of the application.

A faint hope for what you are trying to do might be something like _MouseMovePlus(). I've never used it, but I believe it was described as being able to do mouse movement and clicks inside minimized windows. So maybe that would work...

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Yes, you need to only be running one script, but are you sure that you must use the mouse? Take a look at the Control functions like xcal mentioned. If you must use the mouse, then consider changing the title of each window as they startup so that you can control them individually.

WinSetTitle ()

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • 13 years later...

;~ shizuku (43.48%)
;~ ahk_class ApolloRuntimeContentWindow
;~ ahk_exe Live2D Viewer.exe
;~ ahk_pid 29676
SetTitleMatchMode RegEx
CoordMode, Mouse, Screen
beginning:
loop{
 MouseGetPos, xx, yy
 ControlClick,X%xx% Y%yy%, shizuku\.modell \(\d+.*,,LEFT,1,D
 sleep 200
}

 
End::
exitapp
return

can help me run ths script ths doesnt seem to work the is not tracking the mouse

 

Link to comment
Share on other sites

  • Moderators

loraevil86,

This is the AutoIt forum - I suggest you post on the AHK forum for help with that script.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...