source: trunk/src/UxthemeWrapper.hpp @ 531

Revision 531, 1.1 KB checked in by Eoin, 11 years ago (diff)

Switched trunk to hal::wform.

Line 
1
2//         Copyright Eóin O'Callaghan 2006 - 2007.
3// Distributed under the Boost Software License, Version 1.0.
4//    (See accompanying file LICENSE_1_0.txt or copy at
5//          http://www.boost.org/LICENSE_1_0.txt)
6
7#pragma once
8
9#include "stdAfx.hpp"
10
11namespace hal
12{
13
14class uxthemeWrapper
15{
16public:
17        typedef BOOL (WINAPI *ISAPPTHEMEDPROC)();
18        typedef HRESULT (WINAPI *DRAWPARENTTHEMEBACKGROUND)(HWND, HDC, RECT*);
19               
20        uxthemeWrapper() :
21                pIsAppThemed(0),
22                pDrawThemeParentBackground(0)
23        {                       
24                hinstDll = ::LoadLibrary(_T("UxTheme.dll"));
25                if (hinstDll)
26                {
27                        pIsAppThemed = 
28                          (ISAPPTHEMEDPROC) ::GetProcAddress(hinstDll, "IsAppThemed");
29
30                        pDrawThemeParentBackground = 
31                          (DRAWPARENTTHEMEBACKGROUND) ::GetProcAddress(hinstDll, "DrawThemeParentBackground");
32                         
33//                      ::MessageBox(0, (hal::wform(L"%1%, %2%") % pIsAppThemed % pDrawThemeParentBackground).str().c_str(), L"Result", 0);
34                }
35        }
36       
37        ~uxthemeWrapper()
38        {
39                ::FreeLibrary(hinstDll);
40        }
41       
42        ISAPPTHEMEDPROC pIsAppThemed;
43        DRAWPARENTTHEMEBACKGROUND pDrawThemeParentBackground;
44       
45private:
46        HMODULE hinstDll;       
47};
48
49uxthemeWrapper& uxtheme();
50
51};
Note: See TracBrowser for help on using the repository browser.