[EXPLORER][SHELL32][USER32] Implement 'Show the Desktop' action of Task Bar (#668)

The keyboard shortcuts Win+D and Win+M are also enabled.

- Implement IShellDispatch4::ToggleDesktop().
- Implement some commands in CTrayWindow.
- Add "sdk/include/reactos/traycmd.h" for tray commands.
- Fix task window switching.
- Improve the user32!SwitchToThisWindow() function and use it.

CORE-14318, CORE-13157
See also: CORE-14806 and CORE-8723
This commit is contained in:
Katayama Hirofumi MZ
2018-07-13 17:34:42 +09:00
committed by Hermès BÉLUSCA - MAÏTO
parent 706a1c5132
commit 75b09f3f88
33 changed files with 391 additions and 52 deletions

View File

@@ -3,10 +3,12 @@
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
* PURPOSE: IShellDispatch implementation
* COPYRIGHT: Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
* Copyright 2018 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
#include "precomp.h"
#include "winsvc.h"
#include <traycmd.h> // tray commands
WINE_DEFAULT_DEBUG_CHANNEL(shell);
@@ -370,7 +372,11 @@ HRESULT STDMETHODCALLTYPE CShellDispatch::WindowsSecurity()
HRESULT STDMETHODCALLTYPE CShellDispatch::ToggleDesktop()
{
TRACE("(%p)\n", this);
return E_NOTIMPL;
HWND hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
PostMessageW(hTrayWnd, WM_COMMAND, TRAYCMD_TOGGLE_DESKTOP, 0);
return S_OK;
}
HRESULT STDMETHODCALLTYPE CShellDispatch::ExplorerPolicy(BSTR policy, VARIANT *value)