strange A_ScreenWidth and A_ScreenHeight behavior

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

strange A_ScreenWidth and A_ScreenHeight behavior

Post by PaigeDown » 01 Feb 2023, 15:55

i have a 3840 x 2160 screen resolution (standard 4k resolution).
A_ScreenWidth and A_ScreenHeight see my correct resolution. if I were to

Code: Select all

WinMove,"A",,0,0,A_ScreenWidth,A_ScreenHeight
it will not completely fill my screen.

after playing with it til i got the exact pixel boarder right, it seems that

Code: Select all

WinMove "A",,0-10,0,(A_ScreenWidth+21),(A_ScreenHeight+11)
is what actually gets the correct fullscreen.
does anyone have any idea why it is behaving this way?

Image

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by boiler » 01 Feb 2023, 16:23

It's a known Windows issue (feature?) that has led to this thread and many others. I believe it has been said that Windows considers the window being the size you changed it to. It's just that part of the border is invisible.

By the way, minor point, but just so no one tries it and wonders why it doesn't work, this line isn't moving/resizing the active window:

Code: Select all

WinMove,"A",,0,0,A_ScreenWidth,A_ScreenHeight
Either of the following would do that:

Code: Select all

WinMove,A,,0,0,A_ScreenWidth,A_ScreenHeight
WinMove,% "A",,0,0,A_ScreenWidth,A_ScreenHeight

PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by PaigeDown » 01 Feb 2023, 18:42

boiler wrote:
01 Feb 2023, 16:23
It's a known Windows issue (feature?) that has led to this thread and many others. I believe it has been said that Windows considers the window being the size you changed it to. It's just that part of the border is invisible.

By the way, minor point, but just so no one tries it and wonders why it doesn't work, this line isn't moving/resizing the active window:

Code: Select all

WinMove,"A",,0,0,A_ScreenWidth,A_ScreenHeight
Either of the following would do that:

Code: Select all

WinMove,A,,0,0,A_ScreenWidth,A_ScreenHeight
WinMove,% "A",,0,0,A_ScreenWidth,A_ScreenHeight
ah, I wrote it from memory and mixed the two.
i was thinking it might be boarder related, as I noticed different windows, chrome, discord, notepad, all seem to frame up slightly differently in when I move them to the same spot.

while on this subject, is it possible to make the height of the window larger? to combat these offsets, I can overextend the width of the window, and I can move its position, but I cannot seem to extend the height of a window beyond my screen's 2160 height. is there a way to go even taller? (if no, I will look into removing the titlebar to gain extra room)

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by boiler » 01 Feb 2023, 19:39

PaigeDown wrote: while on this subject, is it possible to make the height of the window larger? to combat these offsets, I can overextend the width of the window, and I can move its position, but I cannot seem to extend the height of a window beyond my screen's 2160 height. is there a way to go even taller? (if no, I will look into removing the titlebar to gain extra room)
Are you saying you tried a negative Y number and a height of larger than 2160 and it didn't make it larger? What does the following do?

Code: Select all

WinMove, A,, -10, -10, A_ScreenWidth + 20, A_ScreenHeight + 20

PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by PaigeDown » 07 Feb 2023, 11:20

boiler wrote:
01 Feb 2023, 19:39
PaigeDown wrote: while on this subject, is it possible to make the height of the window larger? to combat these offsets, I can overextend the width of the window, and I can move its position, but I cannot seem to extend the height of a window beyond my screen's 2160 height. is there a way to go even taller? (if no, I will look into removing the titlebar to gain extra room)
Are you saying you tried a negative Y number and a height of larger than 2160 and it didn't make it larger? What does the following do?

Code: Select all

WinMove, A,, -10, -10, A_ScreenWidth + 20, A_ScreenHeight + 20
very late response, don't know how I missed it. when I use those coords, it shows some of the title bar moves up, but the bottom just exposes my desktop. let me show you so it makes more sense, I raised the Y so its more pronounced (note -10, -10 has this effect too, just less obvious to see on a 4k screen)
Image

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by boiler » 07 Feb 2023, 11:54

Is "YT" the actual title of the window? I don't understand what the picture is supposed to be showing me since I don't see window corresponding to that name. Is it meant to be the Chrome window?

PaigeDown
Posts: 19
Joined: 24 Dec 2022, 15:26

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by PaigeDown » 07 Feb 2023, 14:14

boiler wrote:
07 Feb 2023, 11:54
Is "YT" the actual title of the window? I don't understand what the picture is supposed to be showing me since I don't see window corresponding to that name. Is it meant to be the Chrome window?
yes, the giant video playing in the background is the window stretched, the window title is YT. the Y should stretch beyond the bottom of my display, but you can see that pink at the bottom, that's my desktop showing. i can move the windows position up, but not elongate it

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: strange A_ScreenWidth and A_ScreenHeight behavior

Post by boiler » 07 Feb 2023, 14:59

Since it's a video window, maybe it's constrained to be a certain aspect ratio, and you have to specify a wider width in order to get the height larger as well.

Post Reply

Return to “Ask for Help (v1)”