From f8096d2b84f29e2352e536b20d5e2d93d9fd0f47 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 27 Aug 2008 12:31:14 -0500 Subject: [PATCH] systray: Keep systray hidden when requested by moving it off screen. --- programs/explorer/systray.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 8b82d9a5a40..07e683a8aa2 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -430,6 +430,14 @@ static BOOL handle_incoming(HWND hwndSource, COPYDATASTRUCT *cds) return ret; } +static void do_hide_systray(void) +{ + SetWindowPos( tray_window, 0, + GetSystemMetrics(SM_XVIRTUALSCREEN) + GetSystemMetrics(SM_CXVIRTUALSCREEN), + GetSystemMetrics(SM_YVIRTUALSCREEN) + GetSystemMetrics(SM_CYVIRTUALSCREEN), + 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); +} + static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -437,6 +445,10 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l case WM_COPYDATA: return handle_incoming((HWND)wparam, (COPYDATASTRUCT *)lparam); + case WM_DISPLAYCHANGE: + if (hide_systray) do_hide_systray(); + break; + case WM_TIMER: cleanup_destroyed_windows(); break; @@ -568,5 +580,8 @@ void initialize_systray(void) WINE_ERR("Could not create tray window\n"); return; } + + if (hide_systray) do_hide_systray(); + SetTimer( tray_window, 1, 2000, NULL ); }