Promote Your Blog
Google

Thursday, January 19, 2012

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);

}

No comments:

Post a Comment