eCo Software Developer Connection


About DevCon
Subscription to DevCon
Budget of DevCon
FAQ


Roadmap
eCo Software runtime
eCo Software toolkit
Contacts

Q: How to restrict window resize?

A: Subclass the window procedure and process this messsages:

   case WM_QUERYTRACKINFO: {
      WinDefWindowProc( hwnd,msg,mp1,mp2 );
      PTRACKINFO pti = (PTRACKINFO)mp2;
      pti->ptlMaxTrackSize.x = bitmap.size.cx + border.cx;
      pti->ptlMaxTrackSize.y = bitmap.size.cy + border.cy;
      return (PVOID)TRUE;
   }
 
   case WM_MINMAXFRAME:
      if ( ((PSWP)mp1)->fl & SWP_MAXIMIZE ) {
         PSWP pswp  = (PSWP)mp1;
         SHORT ytop = pswp->y + pswp->cy;
         pswp->cx   = min( pswp->cx,bitmap.size.cx+border.cx );
         pswp->cy   = min( pswp->cy,bitmap.size.cy+border.cy );
         pswp->y    = ytop - pswp->cy;
         return WinDefWindowProc( hwnd,msg,mp1,mp2 );
      }
 
   default: 
      return WinDefWindowProc( hwnd,msg,mp1,mp2 );
 
en/is_it_necessary_restrict_the_maximal_minimal_size_of_the_window.txt · Last modified: 2009/10/24 13:25 (external edit)

 
Recent changes RSS feed
© 2001 - 2009 eCo Software, All rights reserved