Page 1 of 1

Would WinMove work on a Borderless game like league of legends?

Posted: 11 Jan 2022, 20:19
by Sowy2019
Hey everybody,

I'm new to using AutoHotkey and to this forum, hopefully I'm asking this question in the correct place!

What I've been trying to do is find a script to move or clip my videogames (specifically League of Legends) to the right of my screen. By default its in the middle of my screen and this is native to Windows I believe. I've found many script to move a window with "WinMove", but I haven't been able to find anything about moving a running game. I'm using an ultra wide monitor and I'd like to have my game to one side and room on the right to have other windows open!

First of all is this even possible to do? If so, does anyone have any idea where I could either find a script or find the correct info for me to make my own script?

Thanks in advance for your time!

Cheers,
Sowy

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 11 Jan 2022, 20:48
by YoucefHam
Sowy2019 wrote:
11 Jan 2022, 20:19
Hey everybody,

I'm new to using AutoHotkey and to this forum, hopefully I'm asking this question in the correct place!
...............

Hi try this
and see Help: https://www.autohotkey.com/docs/commands/WinMove.htm

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
#SingleInstance Force

;; change to 0 if you want.
TaskBarHeight := 40

F6::
;; Get the Active window Title.
WinGetTitle, winTitle, A
;; WinMove, WinTitle, WinText, X, Y, Width, Height
x := A_ScreenWidth / 2
y := 0
Width := A_ScreenWidth / 2
Height := A_ScreenHeight - TaskBarHeight
WinMove, %winTitle%,, %x%, %y%, %Width%, %Height%
return

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 11 Jan 2022, 20:58
by Sowy2019
YoucefHam wrote:
11 Jan 2022, 20:48
Sowy2019 wrote:
11 Jan 2022, 20:19
Hey everybody,

I'm new to using AutoHotkey and to this forum, hopefully I'm asking this question in the correct place!
...............

Hi try this
and see Help: https://www.autohotkey.com/docs/commands/WinMove.htm

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
#SingleInstance Force

;; change to 0 if you want.
TaskBarHeight := 40

F6::
;; Get the Active window Title.
WinGetTitle, winTitle, A
;; WinMove, WinTitle, WinText, X, Y, Width, Height
x := A_ScreenWidth / 2
y := 0
Width := A_ScreenWidth / 2
Height := A_ScreenHeight - TaskBarHeight
WinMove, %winTitle%,, %x%, %y%, %Width%, %Height%
return
Hey thanks for the reply! I tried out the script on my game window and also on other windows. It works for every window but not on my game window! It's acting the same as my other scripts I've tried. i saw somewhere that .exe can be used to replace the WinTitle any idea if that can be done?

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 11 Jan 2022, 21:46
by YoucefHam
Sowy2019 wrote:
11 Jan 2022, 20:58
Hey thanks for the reply! I tried out the script on my game window and also on other windows. It works for every window but not on my game window! It's acting the same as my other scripts I've tried. i saw somewhere that .exe can be used to replace the WinTitle any idea if that can be done?

try this

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
#SingleInstance Force

;; change to 0 if you want.
TaskBarHeight := 40

F6::
;; relace calc.exe with the game exe name
winTitle = ahk_exe calc.exe
;; WinMove, WinTitle, WinText, X, Y, Width, Height
x := A_ScreenWidth / 2
y := 0
Width := A_ScreenWidth / 2
Height := A_ScreenHeight - TaskBarHeight
WinMove, %winTitle%,, %x%, %y%, %Width%, %Height%
return

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 11 Jan 2022, 22:12
by Sowy2019
YoucefHam wrote:
11 Jan 2022, 21:46

try this

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
#SingleInstance Force

;; change to 0 if you want.
TaskBarHeight := 40

F6::
;; relace calc.exe with the game exe name
winTitle = ahk_exe calc.exe
;; WinMove, WinTitle, WinText, X, Y, Width, Height
x := A_ScreenWidth / 2
y := 0
Width := A_ScreenWidth / 2
Height := A_ScreenHeight - TaskBarHeight
WinMove, %winTitle%,, %x%, %y%, %Width%, %Height%
return
I really appreciate the help, unfortunately that one also did not work. I tried every .exe files in the game install folder also! Maybe its not possible to do after all!

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 13 Jan 2022, 14:29
by Sowy2019
If anyone else has a any insight on this matter it would be appreciated!

Re: Would WinMove work on a Borderless game like league of legends?

Posted: 13 Jan 2022, 20:16
by swagfag
  • run as admin
  • maybe ur wintitles are wrong. best check with some dedicated tool, eg spy++
  • maybe the active window is not the one that the game is being rendered on(unlikely, but who knows what theyve come up with these days)
  • maybe ure not running windowed mode
  • try different APIs, eg SetWindowPos()