Silverfrost Forums

Welcome to our forums

When a Window changes

22 Aug 2019 4:34 #24216

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.

22 Aug 2019 5:43 #24217

One possible approach is to call the Windows API function IsIconic. This tells you whether or not the window is currently minimised.

22 Aug 2019 5:51 #24218

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

22 Aug 2019 6:36 #24219

Paul and Eddie, thanks for the hints. I'll pursue it!

22 Aug 2019 6:49 #24220

IsIconic works great, and since it returns a LOGICAL, easy enough to use!

Thanks!!

Please login to reply.