Ad Code

Responsive Advertisement

How To Resize Window to Screen Size in VC++

Add following code to OnCreate function in MainFrm.cpp:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

CClientDC mDC(this) ;

int x = mDC.GetDeviceCaps(HORZRES);

int y = mDC.GetDeviceCaps(VERTRES);

this->SetWindowPos(NULL,0,0,x,y,NULL);

}

Post a Comment

0 Comments