int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; SetIcon(AfxGetApp()->LoadIcon(IDI_YOURICON),FALSE); return 0; }
这样就可以了: OnInitDialog中: this->ModifyStyle(0, WS_SYSMENU); SetWindowText("dsf"); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
SetIcon(AfxGetApp()->LoadIcon(IDI_YOURICON),FALSE);
return 0;
}
OnInitDialog中:
this->ModifyStyle(0, WS_SYSMENU);
SetWindowText("dsf");
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon