Skip to content

Commit

Permalink
Ignore desktop window and descendants of taskbar.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarao committed Sep 17, 2010
1 parent 2762539 commit 7b6914b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mmwnd/mmwndhook/mmwndhook_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ bool adjust_pos(HWND hwnd) {

if (pt.x == rect.left && pt.y == rect.top) return false; // no change

// ignore desktop window
HWND desktop = ::GetDesktopWindow();
if (hwnd == desktop) return false;


// ignore descendants of taskbar
HWND root = NULL;
HWND tmp = hwnd;
do { root = tmp; } while ((tmp = ::GetParent(tmp)) && tmp != desktop);
TCHAR root_class[16];
if (::GetClassName(root, root_class, 16) &&
gnn::tstring(_T("Shell_TrayWnd")) == root_class) return false;

HWND parent = ::GetParent(hwnd);
if ((wi.dwStyle & WS_CHILD) && parent) ::ScreenToClient(parent, &pt);
::MoveWindow(hwnd, pt.x, pt.y, width, height, TRUE);
Expand Down

0 comments on commit 7b6914b

Please sign in to comment.