forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

When a Window changes

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 609
Location: Morrison, CO, USA

PostPosted: Thu Aug 22, 2019 5:34 pm    Post subject: When a Window changes Reply with quote

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
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6004
Location: Salford, UK

PostPosted: Thu Aug 22, 2019 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2026
Location: Yateley, Hants, UK

PostPosted: Thu Aug 22, 2019 6:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 609
Location: Morrison, CO, USA

PostPosted: Thu Aug 22, 2019 7:36 pm    Post subject: Reply with quote

Paul and Eddie, thanks for the hints. I'll pursue it!
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 609
Location: Morrison, CO, USA

PostPosted: Thu Aug 22, 2019 7:49 pm    Post subject: Reply with quote

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

Thanks!!
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1177
Location: Aerospace Valley

PostPosted: Thu Aug 22, 2019 10:02 pm    Post subject: Reply with quote

Bill,
Quote:
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.

That's one weird 'standard to hit on whatever version of windows one might have.

It's (well) off-screen !
I'd guess the width and height refers to the 'icons bar' i.e. the zone along the bottom of the screen just above the task bar where minimized windows icons are placed.

The other question to be considered is, what happens if there is more than one reduced window ?
Do all have the same (offscreen) position co-ordinate then I assume (which indicates simply that the window is reduced to an icon) ? or does windows go all bohemian and create a rhapsody of different 'position' co-ordinates for each icon I wanda.

Not forgetting what it might produce if the task bar was not the standard heigt or positioned at one of the other sides of the screen.

I remember some previous discussions we had on posts concerning MDI child windows and that at the time some positions of minimized windows icons were not consistent with what one expected.
Maybe that could have been related to similar subtle issues regarding positioning parameters .
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group