在多线程程序中
AfxGetApp()->m_pMainWnd 应用程序主线程的句柄,在一个多线程应用程序中是唯一的
AfxGetMainWnd() 调用线程的句柄,暨当前语句所在线程的句柄,不唯一。
If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.