// TODO: Add extra initialization here //Just add only one code line in here ,Everything is OK! this->ShowWindow(SW_SHOWMAXIMIZED);//加上这句 return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
替换为:
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
m_pMainWnd->UpdateWindow();
如果不是单窗体的怎么办?比如是一个project底下的一个dialoge。
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//Just add only one code line in here ,Everything is OK!
this->ShowWindow(SW_SHOWMAXIMIZED);//加上这句
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}