CWinThread::m_pMainWnd
This data member contains a pointer to a CWnd object. Use this data member to store a pointer to the main window object of your thread.
The MFC for Windows CE automatically terminates your thread when the window referred to by m_pMainWnd is closed. If this thread is the primary thread for an application, the application will also be terminated. If this data member is NULL, the main window for the CWinApp object of the application will be used to determine when to terminate the thread. m_pMainWnd is a public variable of type CWnd*.
Typically, you set this member variable when you override InitInstance. In a worker thread, the value of this data member is inherited from its parent thread.
CWnd* m_pMainWnd;
Requirements
Windows CE versions: 1.0 and later
Header file: Declared in Afxwin.h
Platform: H/PC Pro, Palm-size PC, Pocket PC
See Also
CWinThread::InitInstance, CWnd
多查查MSDN不就知道这些了呢