| View previous topic :: View next topic |
| Author |
Message |
strictlyfocused02
Joined: 21 Jan 2009 Posts: 45
|
Posted: Wed Jan 21, 2009 12:58 pm Post subject: Struggling with resizing windows ... |
|
|
Goal: to get a window to resize to 1/4 of whatever monitor the coordinates are set to.
Problem: it can calculate the window size just fine on monitor2, but on every other monitor it calculates smaller than what it should.
Ive got a vertical task bar on my primary monitor (Monitor2) that is 100 pixels wide. My resolution is 1680x1050 on each monitor for a total of 6720x1050.
Monitor1 ---- Monitor3 ---- Monitor2 ---- Monitor4
Example: | Code: | ;;-----Variables-----
SetTitleMatchMode, 2
SysGet, Monitor, MonitorWorkArea
RealWidth := (MonitorRight-MonitorLeft)
RealHeight := (MonitorBottom-MonitorTop)
HalfWidth := (RealWidth/2)
HalfHeight := (RealHeight/2)
NotepadHori := -3360
NotepadVert := 0
;;-----Script-----
Run, %SystemRoot%\system32\notepad.exe
WinWait, Notepad
Sleep 500
WinMove, Notepad,, %NotepadHori%,%NotepadVert%, %HalfWidth%,%HalfHeight% |
With this code I get a notepad window that is 790 pixels wide where I want it to be 840 pixels.
Any and all help will be very much appreciated!  |
|
| Back to top |
|
 |
ifckladyluck
Joined: 20 Jan 2009 Posts: 16
|
|
| Back to top |
|
 |
strictlyfocused02
Joined: 21 Jan 2009 Posts: 45
|
Posted: Thu Jan 22, 2009 6:12 am Post subject: |
|
|
I had a chance to test your suggestion and it works for all the monitors except monitor2. When notepad is launched on monitor2 it is 50 pixels too wide.
I dont know where to go from here, Ive been trying to research how other scripts (WindowPad, etc) are able to properly calculate the size but Im not able to replicate what they are able to do. |
|
| Back to top |
|
 |
strictlyfocused02
Joined: 21 Jan 2009 Posts: 45
|
Posted: Fri Jan 23, 2009 11:33 am Post subject: |
|
|
bump  |
|
| Back to top |
|
 |
|