Chromium Code Reviews| Index: ui/base/win/hwnd_util.cc |
| =================================================================== |
| --- ui/base/win/hwnd_util.cc (revision 134578) |
| +++ ui/base/win/hwnd_util.cc (working copy) |
| @@ -6,6 +6,7 @@ |
| #include "base/i18n/rtl.h" |
| #include "base/string_util.h" |
| +#include "base/win/metro.h" |
| #include "ui/gfx/rect.h" |
| #include "ui/gfx/size.h" |
| @@ -181,4 +182,19 @@ |
| SendMessage(window, WM_SYSCOMMAND, command, 0); |
| } |
| +extern "C" { |
| + typedef HWND (*RootWindow)(); |
| +} |
| + |
| +HWND GetRootWindow(bool is_child_window) { |
| + HMODULE metro = base::win::GetMetroModule(); |
| + if (!metro) { |
|
sky
2012/05/01 15:40:39
nit: no {}
|
| + return is_child_window ? ::GetDesktopWindow() : HWND_DESKTOP; |
| + } |
| + // In windows 8 metro-mode the root window is not the desktop. |
| + RootWindow root_window = |
| + reinterpret_cast<RootWindow>(::GetProcAddress(metro, "GetRootWindow")); |
| + return root_window(); |
| +} |
| + |
| } // namespace ui |