AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Position of a minimized window

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Feanix
Guest





PostPosted: Fri May 23, 2008 1:16 am    Post subject: Position of a minimized window Reply with quote

Is there a way to get the coordinates for a minimized window without using winRestore to restore it?

When the window is minimized, the coordinates are reported as -32000, -32000 with WinGetPos, since that is where winXP actually puts minimized windows. I would like to get the coordinates that the window would have, if it was not minimized.

Additionally, is there a way to tell if a minimized window is also maximized? (i.e. if I unminimized it it with WinRestore, would it be maximized?)
I know about WinGet, but that does only report either maximized or minimized, not both.

If possible I would like to do the above without any visual change.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1337

PostPosted: Fri May 23, 2008 3:28 am    Post subject: Re: Position of a minimized window Reply with quote

What you are looking for is GetWindowPlacement API. I searched the forum and found a relevant post:
http://www.autohotkey.com/forum/topic27594.html&highlight=getwindowplacement

Feanix wrote:
Additionally, is there a way to tell if a minimized window is also maximized? (i.e. if I unminimized it it with WinRestore, would it be maximized?)

The second parameter, flags, will tell you about it, WPF_RESTORETOMAXIMIZED (=2).
Back to top
View user's profile Send private message
ImprisonedPride



Joined: 30 Apr 2008
Posts: 28

PostPosted: Fri May 23, 2008 3:45 am    Post subject: Reply with quote

It's really quite convenient that this thread popped up because I have similar question about minimized GUI's. When I minimize a secondary GUI (by means of the minimize button), it shrinks to about the size of 1/2 the title bar in width and only the title bar's height. Is there a way to place this window when it's minimized though without doing automating a click of the title bar and using MouseDrag?
_________________
Call me IP.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1337

PostPosted: Fri May 23, 2008 5:24 am    Post subject: Reply with quote

ImprisonedPride wrote:
Is there a way to place this window when it's minimized though without doing automating a click of the title bar and using MouseDrag?

It's supposed to be done through SetWindowPlacement API by combining existing flags with WPF_SETMINPOSITION and by altering ptMinPosition (sub)struct, but it didn't work as I expected when I tried.
Back to top
View user's profile Send private message
Feanix
Guest





PostPosted: Fri May 23, 2008 10:37 am    Post subject: Reply with quote

Thanks Sean, that is exactly what I was looking for!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group