From 1724ea64fb43c8cfee7cc6601507aab329694b66 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Thu, 6 Feb 2014 13:01:54 +0000 Subject: [PATCH] [explorer_new] - Implement showing and closing the start menu by pressing the WIN key - Implement handling WM_KLUDGEMINRECT message that informs the window manager the place of an application in the taskbar in order to show the minimization or maximization animation of a window - Implement showing taskbar settings when the user selects to show the taskbar settings from the settings menu in start menu - Implement hiding the Favorites menu in the start menu when needed svn path=/branches/shell-experiments/; revision=62010 --- base/shell/explorer-new/precomp.h | 1 + base/shell/explorer-new/startmnu.c | 10 +++++++++- base/shell/explorer-new/taskswnd.c | 21 +++++++++++++++++++++ base/shell/explorer-new/traywnd.c | 18 ++++++++++++++++-- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/base/shell/explorer-new/precomp.h b/base/shell/explorer-new/precomp.h index 7c67c9a2fcd..c96cbd7393d 100644 --- a/base/shell/explorer-new/precomp.h +++ b/base/shell/explorer-new/precomp.h @@ -23,6 +23,7 @@ #include #include #include +#include #include "tmschema.h" #include "resource.h" diff --git a/base/shell/explorer-new/startmnu.c b/base/shell/explorer-new/startmnu.c index bcfc662886f..ae8ac0100dd 100644 --- a/base/shell/explorer-new/startmnu.c +++ b/base/shell/explorer-new/startmnu.c @@ -552,7 +552,15 @@ IStartMenuSiteImpl_AppendMenu(IN OUT ITrayPriv *iface, TEXT("Advanced"), TEXT("StartMenuLogoff"))); - /* FIXME: Favorites */ + /* Favorites */ + if (!GetExplorerRegValueSet(HKEY_CURRENT_USER, + TEXT("Advanced"), + TEXT("StartMenuFavorites"))) + { + DeleteMenu(hMenu, + IDM_FAVORITES, + MF_BYCOMMAND); + } /* Documents */ if (SHRestricted(REST_NORECENTDOCSMENU)) diff --git a/base/shell/explorer-new/taskswnd.c b/base/shell/explorer-new/taskswnd.c index 5b1abb7fe41..9a286f96974 100644 --- a/base/shell/explorer-new/taskswnd.c +++ b/base/shell/explorer-new/taskswnd.c @@ -1632,6 +1632,9 @@ TaskSwitchWnd_HandleShellHookMsg(IN OUT PTASK_SWITCH_WND This, break; case HSHELL_TASKMAN: + PostMessage(ITrayWindow_GetHWND(This->Tray), TWM_OPENSTARTMENU,0, 0); + break; + case HSHELL_LANGUAGE: case HSHELL_SYSMENU: case HSHELL_ENDTASK: @@ -2123,6 +2126,24 @@ ForwardContextMenuMsg: break; #endif + case WM_KLUDGEMINRECT: + { + PTASK_ITEM TaskItem = TaskSwitchWnd_FindTaskItem(This, (HWND)wParam); + if (TaskItem) + { + RECT* prcMinRect = (RECT*)lParam; + RECT rcItem, rcToolbar; + SendMessageW(This->hWndToolbar,TB_GETITEMRECT, TaskItem->Index, (LPARAM)&rcItem); + GetWindowRect(This->hWndToolbar, &rcToolbar); + + OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top); + + *prcMinRect = rcItem; + return TRUE; + } + return FALSE; + } + default: /* HandleDefaultMessage: */ if (uMsg == This->ShellHookMsg && This->ShellHookMsg != 0) diff --git a/base/shell/explorer-new/traywnd.c b/base/shell/explorer-new/traywnd.c index a887319b4f8..b806c5dd490 100644 --- a/base/shell/explorer-new/traywnd.c +++ b/base/shell/explorer-new/traywnd.c @@ -2550,9 +2550,19 @@ HandleTrayContextMenu: break; case TWM_OPENSTARTMENU: - SendMessage(This->hWnd, WM_COMMAND, MAKEWPARAM(BN_CLICKED, IDC_STARTBTN), (LPARAM)This->hwndStart); - break; + { + HWND hwndStartMenu; + HRESULT hr = IUnknown_GetWindow((IUnknown*)This->StartMenuPopup, &hwndStartMenu); + if (FAILED(hr)) + break; + if (IsWindowVisible(hwndStartMenu)) + SetWindowPos(hwndStartMenu, 0,0,0,0,0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER); + else + SendMessage(This->hWnd, WM_COMMAND, MAKEWPARAM(BN_CLICKED, IDC_STARTBTN), (LPARAM)This->hwndStart); + + break; + } case WM_COMMAND: if ((HWND)lParam == This->hwndStart) { @@ -2603,6 +2613,10 @@ HandleTrayContextMenu: { /* FIXME: Handle these commands as well */ case IDM_TASKBARANDSTARTMENU: + + ITrayWindowImpl_DisplayProperties(ITrayWindow_from_impl(This)); + break; + case IDM_SEARCH: case IDM_HELPANDSUPPORT: break;