AfxGetMainWnd() 就是获得应用程序主窗口的指针, AfxGetMainWnd()->m_hWnd是主窗口的句柄, AfxGetMainWnd()->GetSafeHwnd() 返回主窗口的句柄。