From cd813d619c204c441eaff745ccb36616bc78c43b Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Fri, 22 Aug 2003 13:27:58 +0000 Subject: [PATCH] set work area size svn path=/trunk/; revision=5749 --- reactos/subsys/system/explorer/desktop/desktop.cpp | 6 ++++-- .../subsys/system/explorer/taskbar/desktopbar.cpp | 12 +++++++++--- .../subsys/system/explorer/taskbar/traynotify.cpp | 9 ++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/reactos/subsys/system/explorer/desktop/desktop.cpp b/reactos/subsys/system/explorer/desktop/desktop.cpp index 3fc0cefabc0..a1127a9d65f 100644 --- a/reactos/subsys/system/explorer/desktop/desktop.cpp +++ b/reactos/subsys/system/explorer/desktop/desktop.cpp @@ -209,9 +209,11 @@ LRESULT DesktopWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) break; case WM_SETFOCUS: - // close startup menu and other popup menus like on the tray notification icons + // close startup menu and other popup menus like that of tray notification icons if (wparam) - SendMessage((HWND)wparam, WM_CANCELMODE, 0, 0); + PostMessage((HWND)wparam, WM_CANCELMODE, 0, 0); + else + PostMessage(HWND_BROADCAST, WM_CANCELMODE, 0, 0); goto def; case WM_GETISHELLBROWSER: diff --git a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp index 9569b511778..b5ec8e03e3e 100644 --- a/reactos/subsys/system/explorer/taskbar/desktopbar.cpp +++ b/reactos/subsys/system/explorer/taskbar/desktopbar.cpp @@ -161,14 +161,20 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) goto def; case WM_SIZE: { - ClientRect clnt(_hwnd); + int cx = LOWORD(lparam); int cy = HIWORD(lparam); if (_hwndTaskBar) - MoveWindow(_hwndTaskBar, TASKBAR_LEFT, 0, clnt.right-TASKBAR_LEFT-(NOTIFYAREA_WIDTH+1), cy, TRUE); + MoveWindow(_hwndTaskBar, TASKBAR_LEFT, 0, cx-TASKBAR_LEFT-(NOTIFYAREA_WIDTH+1), cy, TRUE); if (_hwndNotify) - MoveWindow(_hwndNotify, clnt.right-(NOTIFYAREA_WIDTH+1), 1, NOTIFYAREA_WIDTH, cy-2, TRUE); + MoveWindow(_hwndNotify, cx-(NOTIFYAREA_WIDTH+1), 1, NOTIFYAREA_WIDTH, cy-2, TRUE); + + WindowRect rect(_hwnd); + int height = rect.bottom-rect.top; + RECT work_area = {0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)-(height-1)}; + SystemParametersInfo(SPI_SETWORKAREA, 0, &work_area, 0); + PostMessage(HWND_BROADCAST, WM_SETTINGCHANGE, SPI_SETWORKAREA, 0); break;} case WM_CLOSE: diff --git a/reactos/subsys/system/explorer/taskbar/traynotify.cpp b/reactos/subsys/system/explorer/taskbar/traynotify.cpp index cf78b379069..717c6ccd995 100644 --- a/reactos/subsys/system/explorer/taskbar/traynotify.cpp +++ b/reactos/subsys/system/explorer/taskbar/traynotify.cpp @@ -124,8 +124,9 @@ LRESULT NotifyArea::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam) Refresh(); } } - } else - return super::WndProc(nmsg, wparam, lparam); + } + + return super::WndProc(nmsg, wparam, lparam); } return 0; @@ -136,15 +137,13 @@ LRESULT NotifyArea::ProcessTrayNotification(int notify_code, NOTIFYICONDATA* pni switch(notify_code) { case NIM_ADD: case NIM_MODIFY: - if ((int)pnid->uID >= 0) { + if ((int)pnid->uID >= 0) { //TODO: fix for windows task manager NotifyInfo& entry = _icon_map[pnid] = pnid; // a new entry? if (entry._idx == -1) entry._idx = ++_next_idx; - Refresh(); - } else { Refresh(); } break;