Fixes "True Reporter. Mystery of Mistwood" broken startup from launcher when the launcher wants to minimize all windows (which is probably not strictly necessary) but we instead pop Start menu.
From: Paul Gofman pgofman@codeweavers.com
--- dlls/user32/tests/win.c | 27 ++++++++++++++++++++++++++- programs/explorer/systray.c | 10 +++++++++- 2 files changed, 35 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 8dad718e357..72245d546d7 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -1796,7 +1796,7 @@ static void test_shell_window(void)
WaitForSingleObject(hthread, INFINITE);
- DeleteObject(hthread); + CloseHandle(hthread);
CloseDesktop(hdesk); } @@ -13033,6 +13033,30 @@ static void test_WM_NCCALCSIZE(void) DestroyWindow(hwnd); }
+static void test_shell_tray(void) +{ + HWND hwnd, traywnd; + + if (!(traywnd = FindWindowA( "Shell_TrayWnd", NULL ))) + { + skip( "Shell_TrayWnd not found, skipping tests.\n" ); + return; + } + + hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE, + 100, 100, 200, 200, 0, 0, 0, NULL ); + ok( !!hwnd, "failed, error %lu.\n", GetLastError() ); + flush_events( TRUE ); + + ok( !IsIconic( hwnd ), "window is minimized.\n" ); + + SendMessageA( traywnd, WM_COMMAND, 419, 0xdeadbeef ); + flush_events( TRUE ); + todo_wine ok( IsIconic( hwnd ), "window is not minimized.\n" ); + + DestroyWindow(hwnd); +} + START_TEST(win) { char **argv; @@ -13229,4 +13253,5 @@ START_TEST(win) test_topmost();
test_shell_window(); + test_shell_tray(); } diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 3b4e5bdc8ac..702ae9381ab 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -1060,7 +1060,15 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP break;
case WM_COMMAND: - if (HIWORD(wparam) == BN_CLICKED) click_taskbar_button( (HWND)lparam ); + if (HIWORD(wparam) == BN_CLICKED) + { + if (LOWORD(wparam) == 419) + { + FIXME( "Minimize all windows command is not supported.\n" ); + break; + } + click_taskbar_button( (HWND)lparam ); + } break;
case WM_CONTEXTMENU:
Rémi Bernon (@rbernon) commented about dlls/user32/tests/win.c:
- HWND hwnd, traywnd;
- if (!(traywnd = FindWindowA( "Shell_TrayWnd", NULL )))
- {
skip( "Shell_TrayWnd not found, skipping tests.\n" );
return;
- }
- hwnd = CreateWindowW( L"static", L"parent", WS_OVERLAPPEDWINDOW|WS_VISIBLE,
100, 100, 200, 200, 0, 0, 0, NULL );
- ok( !!hwnd, "failed, error %lu.\n", GetLastError() );
- flush_events( TRUE );
- ok( !IsIconic( hwnd ), "window is minimized.\n" );
- SendMessageA( traywnd, WM_COMMAND, 419, 0xdeadbeef );
Maybe we could have a `#define TRAY_MINIMIZE_ALL` for the 419, duplicated there and in explorer, so that grepping it can be easier?
Fwiw there's also 416 that is apparently used to undo the minimization.