Move active window full screen on left of three monitors
Move active window full screen on left of three monitors
Hi,
How do I Move active window full screen on left of three monitors -- by AHK code?
How do I Move active window full screen on left of three monitors -- by AHK code?
Re: Move active window full screen on left of three monitors
Welcome to this AHK forum.
Click WinMove
Click WinMove
Re: Move active window full screen on left of three monitors
I put together a line below, saved and reloaded script. Tried with a calculator, notepad windows, by Ctrl Shift L, but nothing happens?
Code: Select all
^+l::WinMove, -1920,0 ;Ctrl Shift L - moves active window to left monitor
Re: Move active window full screen on left of three monitors
"Groundhog Day", jejeje.
Visit this thread viewtopic.php?f=76&t=100651, or make use of the search. There is usually a response of all kinds and for all tastes.
Visit this thread viewtopic.php?f=76&t=100651, or make use of the search. There is usually a response of all kinds and for all tastes.
Re: Move active window full screen on left of three monitors
Hi, 2Took
What was said in the other thread. Microsoft Windows have by default a keyboard shortcut to change the screen of the application under the mouse, it is Windows key+Shift+right or left key, depending on the relative position of the application (if you only have two monitors, pressing the key to the right already works).
What was said in the other thread. Microsoft Windows have by default a keyboard shortcut to change the screen of the application under the mouse, it is Windows key+Shift+right or left key, depending on the relative position of the application (if you only have two monitors, pressing the key to the right already works).
Re: Move active window full screen on left of three monitors
Here's a one liner that works in moving active window to the left monitor, full screen (used Window Spy for coordinates):
Code: Select all
^+l::WinMove, A,, -1920,0 ;Ctrl Shift L - moves active window to left monitor
- Justin-TestBot101a
- Posts: 33
- Joined: 04 Aug 2022, 20:00
Re: Move active window full screen on left of three monitors
Sorry to bother, but I am unable to get this window to move.. Could you tell me what is wrong?
Everything else works, but the window never moves or minimizes..
Everything else works, but the window never moves or minimizes..
Code: Select all
Pause::
launchLuaMacros:
Process, Exist, LuaMacros.exe
if (ErrorLevel)
{
;Process, Close, %ErrorLevel% ; originally let you toggle LuaMacros on/off. Disabled now.
}
else
{
MsgBox, 4,, Would you like to start LuaMacros?
IfMsgBox, Yes
{
Run *RunAs LuaMacros.exe MacroBoard-Jt.lua -r ; admin-runs LuaMacros, loads the correct lua script
WinWait, LuaMacros - MacroBoard-Jt.lua ahk_class Window ; Wait for window to open
WinMove, LuaMacros - MacroBoard-Jt.lua ahk_class Window, , 595, -777 ; Moves class to location
WinMinimize, LuaMacros - MacroBoard-Jt.lua ahk_class Window ; Minimize the window
Sleep 2000
}
}
return
Last edited by Justin-TestBot101a on 19 Aug 2022, 01:09, edited 2 times in total.
Re: Move active window full screen on left of three monitors
WinWait, WinMove, WinMinimize,…
A window title or other criteria identifying the target window. See WinTitle.
A window title or other criteria identifying the target window. See WinTitle.
- Justin-TestBot101a
- Posts: 33
- Joined: 04 Aug 2022, 20:00
- Justin-TestBot101a
- Posts: 33
- Joined: 04 Aug 2022, 20:00
Re: Move active window full screen on left of three monitors
WinTitle is not working for LuaMacros window...
Is there anything else?
P.S.
This is what Window Spy for AHKv2 tells me about the LuaMacros window.
The PID and ID change every time I reopen the program.
- Attachments
-
- image.png (9.33 KiB) Viewed 1119 times
Re: Move active window full screen on left of three monitors
Afaics, you start the Lua program elevated. Then your script needs to run elevated as well.
https://www.autohotkey.com/docs/FAQ.htm#uac
https://www.autohotkey.com/docs/FAQ.htm#uac
- Justin-TestBot101a
- Posts: 33
- Joined: 04 Aug 2022, 20:00
Re: Move active window full screen on left of three monitors
I was thinking that, but did not add it.. Thank you! It works great now!gregster wrote: ↑19 Aug 2022, 04:17Afaics, you start the Lua program elevated. Then your script needs to run elevated as well.
https://www.autohotkey.com/docs/FAQ.htm#uac
Code: Select all
full_command_line := DllCall("GetCommandLine", "str")
if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
{
try
{
if A_IsCompiled
Run *RunAs "%A_ScriptFullPath%" /restart
else
Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
}
ExitApp
}
;MsgBox A_IsAdmin: %A_IsAdmin%`nCommand line: %full_command_line%