tags:

views:

64

answers:

1

Hi, In my VC++ MFC applcaiton,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?

A: 

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.

VitalyVal
Blue bar is system frmae with system menu and caption.I use OnGetMinMaxInfo().but it get X,Y postion as 0,0 only.But i want X=0,Y=60.This my OnGetMinMaxInfo()lpMMI->ptMaxTrackSize.x = XBorder-100;lpMMI->ptMaxTrackSize.y = YBorder-100;
Anu