Maximize a window to half of screen (like win 7) PART 2
Posted 29 April 2012 - 06:07 AM
I now have AHK maximizing a specific window to half of the screen. However, I'd like it to do it a drop differently.
When I do this manually in Win 7, the window fills half of the screen, but does not go all the way to the bottom, rather, it stops at the taskbar. That is what I want.
In contrast, the code I have maximizes the window to half screen, but it goes to the very bottom of the screen, and some of the window is hidden under the taskbar.
Here is the code:
WinMove - Notepad,,0,0,A_ScreenWidth/2,A_ScreenHeight
How can I fix this?
Posted 29 April 2012 - 06:28 AM
Anyway, this is why I want A_ScreenWidthWA & A_ScreenHeightWA to be built-in vars...since they are not, let's create them...
SetTitleMatchMode, 2 SysGet, WA_, MonitorWorkArea A_ScreenWidthWA:=WA_Right-WA_Left A_ScreenHeightWA:=WA_Bottom-WA_Top WinMove, Notepad, , WA_Left, WA_Top, A_ScreenWidthWA/2, A_ScreenHeightWA
Posted 29 April 2012 - 06:31 AM
Posted 29 April 2012 - 06:51 AM
Read the Winmove docs, and experiment with the script that JSLover provided.
for example, what happens if you changed A_ScreenWidthWA/2 to A_ScreenWidthWA/4 ??
Posted 29 April 2012 - 08:14 PM
WinMove - Notepad,,0,0,A_ScreenWidth/2,A_ScreenHeight-40
Did the trick.
Posted 29 April 2012 - 11:19 PM
...on your computer, that is...
After some testing, I found out that the taskbar is 40 pixels high.
OMFG... :evil: :twisted: :roll: ...did you not see my reply???
A_ScreenHeightWA would do that for you!!! A_ScreenHeight does the entire screen, so I made a new var called A_ScreenHeightWA...with a "WA" (meaning "Work Area") on the end...Work Area means "the space not occupied by the taskbar"!...my code does exactly what you want, run it.