Link to home
Start Free TrialLog in
Avatar of drilene56
drilene56

asked on

DeferWindowPos doesn't always cause OnSize message

I am using DeferWindowPos to position several child windows (all have same Z-order). I need EndDeferWindowPos to generate an OnSize message each time it is called because I adjust the font based on the window size. It gets called sometimes, but not every time. Any idea why or how to fix it?

   int count = m_PaneList.Count();
   HDWP  hdwp = ::BeginDeferWindowPos(count + 1);

   
   for ( it.First(); it.IsValid(); it.Next() )
   {
      StatusWindowPane* pane = it.Object();
      if ( !pane )
         continue;
     
      pane->SetOrigin(CPoint(rc.left, rc.top));

      if ( hdwp )
            hdwp = ::DeferWindowPos( hdwp, pane->m_hWnd,  NULL, origin.x, origin.y,pane->Width(), rc.Height(),
            SWP_NOZORDER | SWP_NOACTIVATE);

      origin.x += pane->Width();
   }
   if ( hdwp )
      ::EndDeferWindowPos(hdwp);
ASKER CERTIFIED SOLUTION
Avatar of fl0yd
fl0yd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dear drilene56

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "fl0yd"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Avatar of Mindphaser
Mindphaser

Force accepted

** Mindphaser - Community Support Moderator **