Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Position of a minimized window


  • Please log in to reply
4 replies to this topic
Feanix
  • Guests
  • Last active:
  • Joined: --
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.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
What you are looking for is GetWindowPlacement API. I searched the forum and found a relevant post:
<!-- m -->http://www.autohotke... ... wplacement<!-- m -->

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).

ImprisonedPride
  • Members
  • 70 posts
  • Last active: Aug 03 2009 06:44 PM
  • Joined: 30 Apr 2008
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.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

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.

Feanix
  • Guests
  • Last active:
  • Joined: --
Thanks Sean, that is exactly what I was looking for!