Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CoolMenu.h

Go to the documentation of this file.
00001 //
00002 // CoolMenu.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Construction
00031 public:
00032         CCoolMenu();
00033         virtual ~CCoolMenu();
00034 
00035 // Operations
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 // Attributes
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 // Border Hook
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_)

Generated on Thu Dec 15 10:39:34 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2