107 lines
3 KiB
C++
107 lines
3 KiB
C++
// MainFrm.h : interface of the CMainFrame class
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#define MYWM_NOTIFYICON (WM_APP + 100)
|
|
|
|
class CMainFrame : public CFrameWnd
|
|
{
|
|
protected: // create from serialization only
|
|
CMainFrame();
|
|
DECLARE_DYNCREATE(CMainFrame)
|
|
|
|
// Attributes
|
|
public:
|
|
CComboToolBar m_wndToolBar;
|
|
|
|
// Operations
|
|
public:
|
|
|
|
// Overrides
|
|
// ClassWizard generated virtual function overrides
|
|
//{{AFX_VIRTUAL(CMainFrame)
|
|
public:
|
|
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
|
//}}AFX_VIRTUAL
|
|
|
|
// 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;
|
|
BOOL m_inTray;
|
|
NOTIFYICONDATA tnd;
|
|
|
|
BOOL CreateComboBox();
|
|
|
|
// Stuff for painting custom title bar:
|
|
CFont m_fontCaption; // normal system font for active caption
|
|
CFont m_fontAcme; // "ACME" company font (same active/inactive)
|
|
BOOL m_bActive; // whether active or not;
|
|
CRect m_rcCaption; // caption rectangle
|
|
CBitmap m_bmCaption[2]; // bitmap captions active/inactive
|
|
|
|
// Override
|
|
void OnUpdateFrameTitle(BOOL bAddToTitle);
|
|
|
|
// Helpers
|
|
BOOL ReadWindowPlacement(LPWINDOWPLACEMENT pwp);
|
|
void WriteWindowPlacement(LPWINDOWPLACEMENT pwp);
|
|
void SaveWndSize();
|
|
CString GetDocTitle();
|
|
void PaintCaption(BOOL bActive);
|
|
void PaintCaption() { PaintCaption(m_bActive); }
|
|
void CreateFonts();
|
|
CBitmap* GetCaptionBitmap(BOOL bActive);
|
|
|
|
BOOL TrayMessage(DWORD dwMessage, UINT uID, HICON hIcon,
|
|
CString pszTip);
|
|
LONG On_MYWM_NOTIFYICON(UINT wParam, LONG lParam);
|
|
void DeleteTrayIcon();
|
|
|
|
// Generated message map functions
|
|
protected:
|
|
//{{AFX_MSG(CMainFrame)
|
|
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
|
afx_msg void OnClose();
|
|
afx_msg void OnViewStatusBar();
|
|
afx_msg void OnEditFindCombo();
|
|
afx_msg void OnNcPaint();
|
|
afx_msg BOOL OnNcActivate(BOOL bActive);
|
|
afx_msg void OnSysColorChange();
|
|
afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam);
|
|
afx_msg LRESULT OnSettingChange(WPARAM, LPARAM);
|
|
afx_msg void OnViewWndpos();
|
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
|
afx_msg void OnTrayShow();
|
|
afx_msg void OnTrayExit();
|
|
afx_msg void OnDestroy();
|
|
afx_msg void OnViewFlatbar();
|
|
afx_msg void OnUpdateViewFlatbar(CCmdUI* pCmdUI);
|
|
//}}AFX_MSG
|
|
afx_msg void OnUpdateViewStatusBar(CCmdUI* pCmdUI);
|
|
afx_msg void OnUpdateClock(CCmdUI* pCmdUI);
|
|
|
|
// timer call back function
|
|
static void CALLBACK EXPORT UpdateTime(HWND hWnd,UINT nMsg, UINT nIDEvent, DWORD dwTime);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
public:
|
|
inline CStatusBar& GetStatusBar() { return m_wndStatusBar; }
|
|
|
|
};
|
|
|
|
inline CCB32View* GetApplicationView()
|
|
{
|
|
CFrameWnd* pFrame = (CFrameWnd*)AfxGetMainWnd();
|
|
ASSERT(pFrame);
|
|
return (CCB32View*)(pFrame)->GetActiveView();
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|