sbWindowChromeService.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef SBWINDOWCHROMESERVICE_H_
26 #define SBWINDOWCHROMESERVICE_H_
27 
28 #include "sbIWindowChromeService.h"
29 
30 #include <set>
31 #include <windows.h>
32 
34 {
35 public:
37  NS_DECL_SBIWINDOWCHROMESERVICE
38 
40 
41  // The subclassed WndProc
42  static LRESULT WINAPI WndProc(HWND hWnd,
43  UINT uMsg,
44  WPARAM wParam,
45  LPARAM lParam,
46  UINT_PTR uIdSubclass,
47  DWORD_PTR dwRefData);
48 
49 private:
50  ~sbWindowChromeService();
51 
52 protected:
53  // helper to check if DWM composition is enabled
54  static bool IsCompositionEnabled(const sbWindowChromeService* self);
55 
56  // declarations to memoize DwmIsCompositionEnabled
57  typedef HRESULT (WINAPI *t_DwmIsCompositionEnabled)(BOOL *);
58  HMODULE mhDWMAPI;
60 };
61 
62 #define SONGBIRD_WINDOW_CHROME_SERVICE_CONTRACTID \
63  "@songbirdnest.com/Songbird/WindowChromeService;1"
64 #define SONGBIRD_WINDOW_CHROME_SERVICE_CLASSNAME \
65  "Songbird Window Chrome Service"
66 #define SONGBIRD_WINDOW_CHROME_SERVICE_CID \
67 { /* {2DA9047B-2256-4ab0-87D7-EA0AD684027A} */ \
68  0x2da9047b, \
69  0x2256, \
70  0x4ab0, \
71  {0x87, 0xd7, 0xea, 0xa, 0xd6, 0x84, 0x2, 0x7a} \
72 }
73 
74 #endif /* SBWINDOWCHROMESERVICE_H_ */
HRESULT(WINAPI * t_DwmIsCompositionEnabled)(BOOL *)
static LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
t_DwmIsCompositionEnabled mDwmIsCompositionEnabled
static bool IsCompositionEnabled(const sbWindowChromeService *self)
Component used to do platform-level tricks to hide the window chrome. Expected to only be used by sys...
NS_DECL_ISUPPORTS NS_DECL_SBIWINDOWCHROMESERVICE sbWindowChromeService()