隐藏: BOOL CSpyNetStateSvrDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon ShowWindow(SW_HIDE); RunModalLoop(); return TRUE; // return TRUE unless you set the focus to a control } 显示: ShowWindow(SW_SHOW); UpdateWindow();