开发者

OnSize() Problem in VC++

开发者 https://www.devze.com 2022-12-23 21:39 出处:网络
In my VC++ MFC applc开发者_如何学Caiton,i have different views.And in each view,when i maximize it,i changed the size and position to new thing(Normally it fully get maximixed to screen size).But i do

In my VC++ MFC applc开发者_如何学Caiton,i have different views.And in each view,when i maximize it,i changed the size and position to new thing(Normally it fully get maximixed to screen size).But i dont want tht.So in OnSize() i coded like this.

void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
 CMDIChildWnd::OnSize(nType, cx, cy);

 int XBorder = GetSystemMetrics(SM_CXMAXIMIZED);
 int YBorder = GetSystemMetrics(SM_CYMAXIMIZED); 
 switch (nType) 
    { 
        case SIZE_MAXIMIZED: 
 SetWindowPos(NULL,0,60,XBorder-45,YBorder-60,SWP_NOZORDER );
   break;   
 } 
} 

But what happened is?When i maximize the view,its get maximized to above mention size only.But in that blue bar,there si no minimize,maximize,close button. When i double click in the blue bar,its get to resumed to previous postion with all buttons. How can i get that?


I do not understand what is the "blue bar", but you probably can look into the followin directions: modify windows styles (see WS_MAXIMIZE, WS_MAXIMIZEBOX,...); overwrite OnGetMinMaxInfo instead of OnSize.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号