As per this example on Potplayer, it does not respond to a Win+Right shortcut. After expanding to a certain window size, I want the window to expand and fill the bottom vertically.
Note that I cannot use Shift+Win+Down because it changes the window size to 50%, not 65% as I indicated.
How can I achieve that on AutoHotkey?
How to expand window vertically ONLY
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
Here is a way:
Code: Select all
F1::
WinGetPos, X, Y,,, ahk_exe PotPlayerMini64.exe
Height := A_ScreenHeight - Y - 40
WinMove, ahk_exe PotPlayerMini64.exe,, X, Y,, Height
Return
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
unfortunately it did not do anything to expand the window downwards..
I noticed it only responds if I pause for a few seconds before hitting the hotkey another time. Modifying the script to match this behavior didn't work:
I noticed it only responds if I pause for a few seconds before hitting the hotkey another time. Modifying the script to match this behavior didn't work:
Code: Select all
q::
;SendInput !4
WinGetPos, X, Y,,, ahk_exe PotPlayerMini64.exe
Height := A_ScreenHeight - Y - 40
WinMove, ahk_exe PotPlayerMini64.exe,, X, Y,, Height
Sleep 500
WinMove, ahk_exe PotPlayerMini64.exe,, X, Y,, Height
return
Re: How to expand window vertically ONLY
Just in one case this is not applied for me is when the windows is resized manually, because I think Potplayer keep that size until the blue text disappear.
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
Are you sure about the ahk_exe name?
I use 64 bits of Potplayer, it might be not the case for you, use WindowSpy to get ahk_exe name
I use 64 bits of Potplayer, it might be not the case for you, use WindowSpy to get ahk_exe name
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
Well, can you check X, Y, and Height values within a message box before executing WinMove command?, they may be incorrect.
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
the coordinates are correct but it doesn't always move the window. When it does, it changes the horizontal position too.
Is there another way to do this? How do I get ahk to drag the bottom part of the window to the bottom of screen instead?
Is there another way to do this? How do I get ahk to drag the bottom part of the window to the bottom of screen instead?
Re: How to expand window vertically ONLY
Use WinGetPos to figure out where the bottom border of the window is, then use MouseClickDrag to drag it to the bottom of the screen. You might want to use SysGet, ..., MonitorWorkArea to determine the bottom of the screen not including the taskbar. You may be able to just get away with dragging it to a y coordinate that is known to be past the bottom of the screen, and Windows will have it stop at the bottom of the usable screen.
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
is this correct? My taskbar is on the right, so shouldn't be an issue. I tried many times but it only resizes to a quarter of my screen:boiler wrote: ↑21 Jun 2021, 20:16Use WinGetPos to figure out where the bottom border of the window is, then use MouseClickDrag to drag it to the bottom of the screen. You might want to use SysGet, ..., MonitorWorkArea to determine the bottom of the screen not including the taskbar. You may be able to just get away with dragging it to a y coordinate that is known to be past the bottom of the screen, and Windows will have it stop at the bottom of the usable screen.
Code: Select all
Numpad2::
SendInput !4
WinGetPos, X, Y,,, ahk_exe PotPlayerMini64.exe
WinActivate, ahk_exe PotPlayerMini64.exe
MouseClickDrag, L, X, Y, (A_ScreenWidth*2), (A_ScreenHeight*2)
return
- milkygirl90
- Posts: 565
- Joined: 10 Nov 2020, 21:22
Re: How to expand window vertically ONLY
To put it another way, my objective is to resize Evernote to take up 20% of screen size and Potplayer to take up the remaining 80% side by side. Not sure if that makes it easier.
Re: How to expand window vertically ONLY
I don’t understand how the coordinates you selected and the math you showed are supposed to provide the desired result. For one thing, it seems like you would need to specify CoordMode, Mouse, Screen. Then it seems you are attempting to drag the upper-left corner of the window (x,y) to a point way off the screen. Perhaps you can describe the goal of that, and not just be restating, “my objective is to resize Evernote to take up 20% of screen size and Potplayer to take up the remaining 80% side by side.” Are you trying to drag the upper-left corner of the window off the screen, and if so, why?
Who is online
Users browsing this forum: Bing [Bot], Kellyzkorner_NJ and 162 guests