How to get the window size with the same value of AFTER "OnSize()" event at the time of dialog is lo

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi, I have a class named CZoomStatic which is derived from CStatic.
I need to get the size of my control with the value of AFTER "OnSize()" but I need to get it BEFORE "OnSize()" event because I need to calculate the object scale based on the latest size.
The reason I dont do this inside the handler "CZoomStatic::OnSize(UINT nType, int cx, int cy)" is because I have to maintain the position and size of the object everytime the user resize the window.<br/>

So, the point is I just need this information for the FIRST time when the dialog is opened because there is a possibility of OnSize is invoked more than once. Thats why I also cannot use like a flag variable that can be checked if this is the first
time of entering this window. <br/>

The problem happening right now is that everytime I open the dialog for the first time, I cant have the object scale and position desired because the calculation is finished before OnSize() and it is based on the previous size.<br/>

Is there any good solution for my problem?<br/>
<br/>
Thank you very much.
<br/>

View the full article
 
Back
Top