窗体最小化时将发送WM_SIZE消息
SIZE_MAXHIDE,SIZE_MAXIMIZED,SIZE_MAXSHOW,SIZE_MINIMIZED,SIZE_RESTORED
void CTestDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(nType == SIZE_MINIMIZED)
{
ShowWindow(SW_HIDE);
}
}
Me.WindowState = FormWindowState.Minimized