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

Ask gaming related questions (AHK v1.1 and older)
Sowy2019
Posts: 4
Joined: 11 Jan 2022, 20:05

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

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!

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
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

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

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
:wave: There is always more than one way to solve a problem. ;)
Sowy2019
Posts: 4
Joined: 11 Jan 2022, 20:05

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

11 Jan 2022, 20:58

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?
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

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

11 Jan 2022, 21:46

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
:wave: There is always more than one way to solve a problem. ;)
Sowy2019
Posts: 4
Joined: 11 Jan 2022, 20:05

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

11 Jan 2022, 22:12

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!
Sowy2019
Posts: 4
Joined: 11 Jan 2022, 20:05

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

13 Jan 2022, 14:29

If anyone else has a any insight on this matter it would be appreciated!
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

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

13 Jan 2022, 20:16

  • 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()

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: fatnwordmonkeyeater and 44 guests