View previous topic :: View next topic |
Author |
Message |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Thu Aug 22, 2019 5:34 pm Post subject: When a Window changes |
|
|
I know how to get the size and position of a window. What I didn't expect is that when the window is minimised the callback returns some pretty weird values. In my case, with two monitors, the position/size returns -32000 for both the X and Y position, and what would appear to be a width and height about equal to the menu bar.
My question is: Is there a way to determine whether the size/position callback has been called as a result of a minimise operation? I see "RESIZE" is a possibility, but it doesn't give me the insight I was looking for. Unless, when minimising, there is always a set value for X and Y, for example. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Thu Aug 22, 2019 6:43 pm Post subject: |
|
|
One possible approach is to call the Windows API function IsIconic. This tells you whether or not the window is currently minimised. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu Aug 22, 2019 6:51 pm Post subject: |
|
|
I think those are the right coordinates - they minimised coords appear to have varied between old Windows versions but stabilised to (-32000, -32000) with NT and later.
There's a function GetWindowPlacement function (MSDN) that can give you the miniised Window coords - worth looking at.
Paul's solution is probably best.
Eddie |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Thu Aug 22, 2019 7:36 pm Post subject: |
|
|
Paul and Eddie, thanks for the hints. I'll pursue it! |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Thu Aug 22, 2019 7:49 pm Post subject: |
|
|
IsIconic works great, and since it returns a LOGICAL, easy enough to use!
Thanks!! |
|
Back to top |
|
 |
|