Chromium Code Reviews| Index: views/widget/monitor_win.cc |
| =================================================================== |
| --- views/widget/monitor_win.cc (revision 98344) |
| +++ views/widget/monitor_win.cc (working copy) |
| @@ -4,7 +4,7 @@ |
| #include "views/widget/monitor_win.h" |
| -#include <windows.h> |
| +#include <shellapi.h> |
| #include "base/logging.h" |
| #include "ui/gfx/rect.h" |
| @@ -24,4 +24,19 @@ |
| return gfx::Rect(); |
| } |
| +HWND GetTopmostAutoHideTaskbarForEdge(UINT edge, HMONITOR monitor) { |
| + if (monitor == NULL) |
|
Peter Kasting
2011/08/30 18:31:32
Nit: I'd roll this into the conditional below like
jianli
2011/08/30 18:38:55
Done.
|
| + return NULL; |
| + APPBARDATA taskbar_data = { 0 }; |
|
Peter Kasting
2011/08/30 18:31:32
Nit: Shorter:
APPBARDATA taskbar_data = { sizeof
jianli
2011/08/30 18:38:55
Done.
|
| + taskbar_data.cbSize = sizeof APPBARDATA; |
| + taskbar_data.uEdge = edge; |
| + HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, |
| + &taskbar_data)); |
| + if (::IsWindow(taskbar) && |
|
Peter Kasting
2011/08/30 18:31:32
Nit: Shorter:
return (...) ?
taskbar : NULL;
jianli
2011/08/30 18:38:55
Done.
|
| + (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) && |
| + (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST)) |
| + return taskbar; |
| + return NULL; |
| +} |
| + |
| } // namespace views |