Visual Studio MFC MDI application with RichEditView, set default MainFrame window size is 1027*768

  • Thread starter Thread starter gsegria
  • Start date Start date
G

gsegria

Guest
I created Visual Studio MFC MDI application with RichEditView.

I want to set default MainFrame window size is 1027*768.

But that is not success.


========================

Here is my sample code:

========================

App::InitInstance()

{

GetWindowsCenter();

pMainFrame->SetWindowPos(NULL, m_rcOwner.left + (m_rc.right / 2), m_rcOwner.top + (m_rc.bottom / 2), 1024, 768, SWP_NOSIZE);

}

void App::GetWindowsCenter()
{
HWND hwndOwner;
hwndOwner = GetDesktopWindow();
GetWindowRect(hwndOwner, &m_rcOwner);
CopyRect(&m_rc, &m_rcOwner);
OffsetRect(&m_rc, -m_rc.left, -m_rc.top);
}

Continue reading...
 
Back
Top