Index: base/shell/explorer-new/taskswnd.c =================================================================== --- base/shell/explorer-new/taskswnd.c (revision 38933) +++ base/shell/explorer-new/taskswnd.c (working copy) @@ -1802,6 +1802,18 @@ return Ret; } +static VOID +ActivateHWND(IN HWND hwnd) +{ + + if(IsIconic(hwnd))//if minimized then restore + { + ShowWindow(hwnd, SW_RESTORE); + } + SetForegroundWindow(hwnd); +} + + static LRESULT CALLBACK TaskSwitchWndProc(IN HWND hwnd, IN UINT uMsg, @@ -1861,6 +1873,9 @@ if (lParam != 0 && (HWND)lParam == This->hWndToolbar) { DbgPrint("WM_COMMAND %u:%u (%u)\n", (UINT)LOWORD(wParam), (UINT)HIWORD(wParam), (UINT)wParam); + PTASK_ITEM selectItem; + selectItem = FindTaskItemByIndex(This,LOWORD(wParam)); + ActivateHWND(selectItem->hWnd); } break; } @@ -1920,6 +1935,22 @@ if (iBtn >= 0) { /* FIXME: Display the system menu of the window */ + PTASK_ITEM contextItem; + HMENU sysMenu; + contextItem = FindTaskItemByIndex(This,iBtn); + sysMenu = GetSystemMenu(contextItem->hWnd, FALSE); + if(sysMenu) + { + POINT pt; + GetCursorPos(&pt); + int cmd = TrackPopupMenu(sysMenu, TPM_LEFTBUTTON|TPM_RIGHTBUTTON|TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, NULL); + if (cmd) + { + ActivateHWND(contextItem->hWnd);// reactivate window after the context menu has closed + PostMessage(contextItem->hWnd, WM_SYSCOMMAND, cmd, 0); + } + } + } else goto ForwardContextMenuMsg;