部分源码: // MainFrm.h : interface of the CMainFrame class // /**/ ///// #if !defined(AFX_MAINFRM_H__E8C66A23_6409_46C4_859D_C7E0B79A0446__INCLUDED_) #define AFX_MAINFRM_H__E8C66A23_6409_46C4_859D_C7E0B79A0446__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include " ChildView.h " class CMainFrame : public CFrameWnd ... { public: CMainFrame();protected: DECLARE_DYNAMIC(CMainFrame)// Attributespublic:// Operationspublic:// Overrides // ClassWizard generated virtual function overrides //{ {AFX_VIRTUAL(CMainFrame) virtual BOOL PreCreateWindow(CREATESTRUCT& cs); virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); //}}AFX_VIRTUAL// Implementationpublic: virtual ~CMainFrame();#ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const;#endif CChildView m_wndView;// Generated message map functionsprotected: void ToTray(); void DeleteTray(); //{ {AFX_MSG(CMainFrame) afx_msg void OnSetFocus(CWnd *pOldWnd); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg void OnWindowshow(); //}}AFX_MSG afx_msg LRESULT OnShowTask(WPARAM wParam,LPARAM lParam);