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 

Find window state of active window Maximized or Normal

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
hometoast



Joined: 05 Oct 2009
Posts: 5

PostPosted: Wed Jan 13, 2010 4:34 pm    Post subject: Find window state of active window Maximized or Normal Reply with quote

I want to remap

Code:
#Up::WinMaximize,A


and

Code:
#Down::"restore if maximized and minimize if restored"


like it does in Windows 7. I am on Vista.

I can get the windowSize and position, but I can't seem to find if it's maximized or not. How would I find this?
thanks!

p.s. I did search the forums and wiki and google, but everything leads me to WinGetActiveStats
Back to top
View user's profile Send private message
jl34567



Joined: 03 Jan 2010
Posts: 262

PostPosted: Wed Jan 13, 2010 4:40 pm    Post subject: Reply with quote

WinRestore?

Unminimizes or unmaximizes the specified window if it is minimized or maximized.

I generally browse the list of commands....sometimes what you need practically slaps you in the face.......other times not so much.
Back to top
View user's profile Send private message AIM Address
Peter



Joined: 30 Dec 2005
Posts: 448

PostPosted: Wed Jan 13, 2010 4:47 pm    Post subject: Reply with quote

hometoast wrote:
I can't seem to find if it's maximized or not... I did search the forums and wiki and google, but everything leads me to WinGetActiveStats
Search e.g. maximize in AHK Help file, 3rd result: Winget
AHK Help file wrote:
MinMax: Retrieves the minimized/maximized state for a window.
Back to top
View user's profile Send private message
hometoast



Joined: 05 Oct 2009
Posts: 5

PostPosted: Tue Jan 19, 2010 3:52 pm    Post subject: Reply with quote

Thanks to both of you.

jl, it's the WinRestore I'll need to call depending on the value from Winget.

Also, please don't think I didn't search. I just searched for all the wrong things. Also the .chm doesn't work for me at work.. just loads empty.
Back to top
View user's profile Send private message
Jahangir



Joined: 08 Sep 2011
Posts: 4

PostPosted: Thu Sep 08, 2011 5:12 pm    Post subject: Reply with quote

hometoast wrote:
Thanks to both of you.

jl, it's the WinRestore I'll need to call depending on the value from Winget.

Also, please don't think I didn't search. I just searched for all the wrong things. Also the .chm doesn't work for me at work.. just loads empty.


It's an old thread, but for others who look, you need to use the CMD argument to specify what you need:

Code:

#z::
#d::
{
   WinGetActiveTitle, title
   WinGet, maximized, MinMax, %title%
   if (maximized)
      WinRestore, %title%
   else
      WinMaximize, %title%
   return
}
Back to top
View user's profile Send private message
Display posts from previous:   
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