diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 2b8502b56d8..d306bb90c90 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -636,7 +636,7 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR return 0; case WM_PARENTNOTIFY: - if (LOWORD(wp) == WM_DESTROY) cleanup_systray_window( (HWND)lp ); + handle_parent_notify( (HWND)lp, wp ); return 0; case WM_LBUTTONDBLCLK: diff --git a/programs/explorer/explorer_private.h b/programs/explorer/explorer_private.h index dbe50be61ba..995e7eb803e 100644 --- a/programs/explorer/explorer_private.h +++ b/programs/explorer/explorer_private.h @@ -24,7 +24,7 @@ extern void manage_desktop( WCHAR *arg ) DECLSPEC_HIDDEN; extern void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL enable_shell ) DECLSPEC_HIDDEN; extern void initialize_appbar(void) DECLSPEC_HIDDEN; -extern void cleanup_systray_window( HWND hwnd ) DECLSPEC_HIDDEN; +extern void handle_parent_notify( HWND hwnd, WPARAM wp ) DECLSPEC_HIDDEN; extern void do_startmenu( HWND owner ) DECLSPEC_HIDDEN; extern LRESULT menu_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) DECLSPEC_HIDDEN; diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index eca49f7a3c2..8406ad22054 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -447,7 +447,7 @@ static BOOL delete_icon(struct icon *icon) } /* cleanup icons belonging to a window that has been destroyed */ -void cleanup_systray_window( HWND hwnd ) +static void cleanup_systray_window( HWND hwnd ) { struct icon *icon, *next; @@ -680,6 +680,17 @@ static LRESULT WINAPI tray_wndproc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM l return 0; } +/* notifcation posted to the desktop window */ +void handle_parent_notify( HWND hwnd, WPARAM wp ) +{ + switch (LOWORD(wp)) + { + case WM_DESTROY: + cleanup_systray_window( hwnd ); + break; + } +} + /* this function creates the listener window */ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell ) {