WinMove does not move the window Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ravena1
Posts: 62
Joined: 06 Sep 2017, 15:13

WinMove does not move the window

Post by ravena1 » 24 Jan 2022, 08:06

im trying to move my window in precise positon but it does not seem to move
i dont know what is wrong.. any idea?

Code: Select all

mywinclass:="RAGNAROK BUNNY | Gepard Shield 3.0 (^-_-^)"

home::
WinGet, AhkPID, PID, A
WinGetClass, mywinclass, ahk_pid %AhkPID%
IniWrite, %AhkPID%, winmove.ini, process, ahk_pid
IniRead, ahk_pid, winmove.ini, process, ahk_pid
SplashTextOn,,, WINMOVE SCRIPT!! Process ID:%AhkPID% is saved
Sleep 1500
SplashTextOff
sleep 500
WinMove 1066, 589,,, ahk_pid %AhkPID%

User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: WinMove does not move the window

Post by mikeyww » 24 Jan 2022, 08:26

I would try using the command according to the following syntax.

WinMove, WinTitle, WinText, X, Y

Explained: WinMove

Process ID may change from session to session.

Maximized windows sometimes need to be restored.

ravena1
Posts: 62
Joined: 06 Sep 2017, 15:13

Re: WinMove does not move the window

Post by ravena1 » 24 Jan 2022, 09:03

mikeyww wrote:
24 Jan 2022, 08:26
I would try using the command according to the following syntax.

WinMove, WinTitle, WinText, X, Y

Explained: WinMove

Process ID may change from session to session.

Maximized windows sometimes need to be restored.
thats why i use winGet to generate process id everytime i run the script..

but my issue is it cannot move window

i both tried ahk v2 code and legacy code.. it does not seem to move T_T

Code: Select all

WinMove 1066, 589,,, ahk_pid %AhkPID% 

Code: Select all

WinMove, ahk_pid %AhkPID% ,, 1066, 589
am i missing something?

User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: WinMove does not move the window  Topic is solved

Post by mikeyww » 24 Jan 2022, 09:15

I would fix your IniRead so that you use the right output variable-- the one that you are already using.

Try the following in Notepad as a first step.

Code: Select all

ini := StrReplace(A_ScriptFullPath, ".ahk", ".ini")

Home::
WinGet, AhkPID, PID, A
IniWrite, %AhkPID%, %ini%, Process, ahk_pid
IniRead, AhkPID, %ini%, Process, ahk_pid
WinRestore, % winTitle := "ahk_pid " AhkPID
WinMove, %winTitle%,, 1066, 589
Return

Post Reply

Return to “Ask for Help (v1)”