- // MainFrm.h : interface of the CMainFrame class
- //
- #pragma once
- class CMainFrame : public CFrameWnd
- {
- protected: // create from serialization only
- CMainFrame();
- DECLARE_DYNCREATE(CMainFrame)
- // Attributes
- protected:
- CSplitterWnd m_wndSplitter;
- // Overrides
- public:
- virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- ///<summary>
- /// the manager object for manipulating mails
- ///</summary>
- CMailManager m_MailMgnr;
- ///<summary>
- /// the array where stores the position of each mail in the database
- ///</summary>
- CArray<MAILPOS> m_arrMsgPos;
- ///<summary>
- /// the array where stores the size of each mail
- ///</summary>
- CArray<UINT> m_arrMsgSize;
- // Implementation
- public:
- virtual ~CMainFrame();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected: // control bar embedded members
- CStatusBar m_wndStatusBar;
- CToolBar m_wndToolBar;
- // Generated message map functions
- protected:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- DECLARE_MESSAGE_MAP()
- private:
- afx_msg void OnMailSetting();
- afx_msg void OnMailSend();
- afx_msg void OnMailReceive();
- afx_msg void OnClose();
- afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
- virtual void Serialize(CArchive& ar);
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- LRESULT OnTrayNotification(WPARAM wParam,LPARAM lParam);
- LRESULT OnMailListSelected(WPARAM wParam, LPARAM lParam);
- ///<summary>
- /// Add the icon to the system tray
- ///</summary>
- void AddIconToTray();
- ///<summary>
- /// Delete the icon from the system tray
- ///</summary>
- void DelIconFromTray();
- ///<summary>
- /// Open the program when the user click the icon in the tray
- ///</summary>
- void OnTrayOpen();
- ///<summary>
- /// Read the setting from the disk,such as the user name, the smtp server
- ///</summary>
- void ReadMailSetting();
- ///<summary>
- /// Read the former mails saved on the disk
- ///</summary>
- void ReadFormerMails();
- ///<summary>
- /// Read mails fromdatabase and display
- ///</summary>
- void ReadAndDisplayMails(const UINT nState);
- ///<summary>
- /// the array where saves the header of each mail
- ///</summary>
- CArray<CPop3Message> m_arrTopMail;
- ///<summary>
- /// the name of the file where stores the user setting
- ///</summary>
- TCHAR m_szSetFileName[_MAX_PATH];
- ///<summary>
- /// the pointer to the left view
- ///</summary>
- CLeftPaneView* m_pLeftPaneView;
- ///<summary>
- /// the number of the new mails
- ///</summary>
- UINT m_nOldMailCount;
- ///<summary>
- /// whether have mails saved
- ///</summary>
- BOOL m_bHaveSavedMail;
- ///<summary>
- /// whether the program is intializing
- ///</summary>
- BOOL m_bIntialize;
- ///<summary>
- /// the dialog to show the progress
- ///</summary>
- CRecvProgressDlg* m_pProgDlg;
- };