这面的代码应该在OnInitDialog的函数中调用。
- HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- SendMessage( WM_SETICON, TRUE, (LPARAM)hIcon );
- SendMessage( WM_SETICON, FALSE, (LPARAM)hIcon );