ThemeHelperST.h
资源名称:MiniCA2.rar [点击查看]
上传用户:dengkfang
上传日期:2008-12-30
资源大小:5233k
文件大小:3k
源码类别:
CA认证
开发平台:
Visual C++
- //
- // Class: CThemeHelperST
- //
- // Compiler: Visual C++
- // Tested on: Visual C++ 6.0
- //
- // Version: See GetVersionC() or GetVersionI()
- //
- // Created: 09/January/2002
- // Updated: 31/October/2002
- //
- // Author: Davide Calabro' davide_calabro@yahoo.com
- // http://www.softechsoftware.it
- //
- // Note: Based on the CVisualStylesXP code
- // published by David Yuheng Zhao (yuheng_zhao@yahoo.com)
- //
- // Disclaimer
- // ----------
- // THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT
- // ANY WARRANTIES WHETHER EXPRESSED OR IMPLIED. NO REPONSIBILITIES FOR POSSIBLE
- // DAMAGES OR EVEN FUNCTIONALITY CAN BE TAKEN. THE USER MUST ASSUME THE ENTIRE
- // RISK OF USING THIS SOFTWARE.
- //
- // Terms of use
- // ------------
- // THIS SOFTWARE IS FREE FOR PERSONAL USE OR FREEWARE APPLICATIONS.
- // IF YOU USE THIS SOFTWARE IN COMMERCIAL OR SHAREWARE APPLICATIONS YOU
- // ARE GENTLY ASKED TO DONATE 5$ (FIVE U.S. DOLLARS) TO THE AUTHOR:
- //
- // Davide Calabro'
- // P.O. Box 65
- // 21019 Somma Lombardo (VA)
- // Italy
- //
- #ifndef _THEMEHELPERST_H_
- #define _THEMEHELPERST_H_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #ifndef HTHEME
- #define HTHEME HANDLE
- #endif
- class CThemeHelperST
- {
- public:
- CThemeHelperST();
- virtual ~CThemeHelperST();
- //new
- // typedef HRESULT(__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hwnd,HDC hdc,RECT *prc);
- HTHEME OpenThemeData(HWND hwnd, LPCWSTR pszClassList);
- HRESULT CloseThemeData(HTHEME hTheme);
- HRESULT DrawThemeBackground(HTHEME hTheme, HWND hWnd, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect);
- HRESULT DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT* pRect);
- BOOL IsThemeActive();
- BOOL IsAppThemed();
- static short GetVersionI() {return 11;}
- static LPCTSTR GetVersionC() {return (LPCTSTR)_T("1.1");}
- private:
- LPVOID GetProc(LPCSTR szProc, LPVOID pfnFail);
- typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
- static HTHEME __stdcall OpenThemeDataFail(HWND, LPCWSTR) {return NULL;}
- typedef HRESULT(__stdcall *PFNCLOSETHEMEDATA)(HTHEME hTheme);
- static HRESULT __stdcall CloseThemeDataFail(HTHEME) {return E_FAIL;}
- typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT* pRect, const RECT* pClipRect);
- static HRESULT __stdcall DrawThemeBackgroundFail(HTHEME, HDC, int, int, const RECT*, const RECT*) {return E_FAIL;}
- typedef HRESULT(__stdcall *PFNDRAWTHEMEPARENTBACKGROUND)(HWND hWnd, HDC hdc, RECT* pRect);
- typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT* pRect);
- static HRESULT __stdcall DrawThemeTextFail(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT*) {return E_FAIL;}
- typedef BOOL(__stdcall *PFNISAPPTHEMED)();
- static BOOL __stdcall IsAppThemedFail() {return FALSE;}
- typedef BOOL (__stdcall *PFNISTHEMEACTIVE)();
- static BOOL __stdcall IsThemeActiveFail() {return FALSE;}
- HMODULE m_hDll;
- };
- #endif