00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_COOLMENU_H__A1413F8B_7E02_4897_9C24_597CA8ACEE8F__INCLUDED_)
00023 #define AFX_COOLMENU_H__A1413F8B_7E02_4897_9C24_597CA8ACEE8F__INCLUDED_
00024
00025 #pragma once
00026
00027
00028 class CCoolMenu
00029 {
00030
00031 public:
00032 CCoolMenu();
00033 virtual ~CCoolMenu();
00034
00035
00036 public:
00037 BOOL AddMenu(CMenu* pMenu, BOOL bChild = FALSE);
00038 void SetWatermark(HBITMAP hBitmap);
00039 void OnMeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
00040 void OnDrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00041 protected:
00042 void DrawMenuText(CDC* pDC, CRect* pRect, const CString& strText);
00043 void DrawWatermark(CDC* pDC, CRect* pRect, int nOffX, int nOffY);
00044
00045
00046 protected:
00047 CMap<DWORD, DWORD, CString, CString&> m_pStrings;
00048 int m_nCheckIcon;
00049 protected:
00050 CBitmap m_bmWatermark;
00051 CDC m_dcWatermark;
00052 CSize m_czWatermark;
00053 HBITMAP m_hOldMark;
00054 protected:
00055 BOOL m_bEnable;
00056 BOOL m_bUnhook;
00057
00058
00059 public:
00060 void EnableHook();
00061 static void EnableHook(BOOL bEnable);
00062 static void RegisterEdge(int nLeft, int nTop, int nLength);
00063 static BOOL IsModernVersion();
00064 protected:
00065 static LRESULT CALLBACK MsgHook(int nCode, WPARAM wParam, LPARAM lParam);
00066 static LRESULT CALLBACK MenuProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
00067 protected:
00068 static HHOOK m_hMsgHook;
00069 static LPCTSTR wpnOldProc;
00070 static BOOL m_bPrinted;
00071 static int m_nEdgeLeft;
00072 static int m_nEdgeTop;
00073 static int m_nEdgeSize;
00074
00075 };
00076
00077 extern CCoolMenu CoolMenu;
00078
00079 #endif // !defined(AFX_COOLMENU_H__A1413F8B_7E02_4897_9C24_597CA8ACEE8F__INCLUDED_)