AutoHotkey Community

It is currently May 26th, 2012, 2:30 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: January 21st, 2009, 1:58 pm 
Offline

Joined: January 21st, 2009, 1:06 pm
Posts: 63
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! :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2009, 3:25 pm 
Offline

Joined: January 20th, 2009, 9:35 pm
Posts: 16
use Monitor instead of MonitorWorkArea

http://www.autohotkey.com/docs/commands/SysGet.htm


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 22nd, 2009, 7:12 am 
Offline

Joined: January 21st, 2009, 1:06 pm
Posts: 63
ifckladyluck wrote:
use Monitor instead of MonitorWorkArea

http://www.autohotkey.com/docs/commands/SysGet.htm


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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2009, 12:33 pm 
Offline

Joined: January 21st, 2009, 1:06 pm
Posts: 63
bump 8)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto, poserpro and 19 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group