[explorer_new]
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Thu, 6 Feb 2014 13:01:54 +0000 (13:01 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Thu, 6 Feb 2014 13:01:54 +0000 (13:01 +0000)
- 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
base/shell/explorer-new/startmnu.c
base/shell/explorer-new/taskswnd.c
base/shell/explorer-new/traywnd.c

index 7c67c9a..c96cbd7 100644 (file)
@@ -23,6 +23,7 @@
 #include <shlguid_undoc.h>
 #include <uxtheme.h>
 #include <strsafe.h>
+#include <undocuser.h>
 
 #include "tmschema.h"
 #include "resource.h"
index bcfc662..ae8ac01 100644 (file)
@@ -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))
index 5b1abb7..9a286f9 100644 (file)
@@ -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)
index a887319..b806c5d 100644 (file)
@@ -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;