[ros-diffs] [gedmurphy] 41848: - Add the task manager to the tray context menu - Add a bit of code for the tray properties dialog

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Fri Jul 10 19:10:21 CEST 2009


Author: gedmurphy
Date: Fri Jul 10 21:10:20 2009
New Revision: 41848

URL: http://svn.reactos.org/svn/reactos?rev=41848&view=rev
Log:
- Add the task manager to the tray context menu
- Add a bit of code for the tray properties dialog

Modified:
    trunk/reactos/base/shell/explorer-new/lang/en-US.rc
    trunk/reactos/base/shell/explorer-new/resource.h
    trunk/reactos/base/shell/explorer-new/trayprop.c
    trunk/reactos/base/shell/explorer-new/traywnd.c

Modified: trunk/reactos/base/shell/explorer-new/lang/en-US.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/lang/en-US.rc?rev=41848&r1=41847&r2=41848&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer-new/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/lang/en-US.rc [iso-8859-1] Fri Jul 10 21:10:20 2009
@@ -4,6 +4,10 @@
 BEGIN
     POPUP ""
     BEGIN
+
+        MENUITEM SEPARATOR
+        MENUITEM "Task Manager", ID_SHELL_CMD_OPEN_TASKMGR
+        MENUITEM SEPARATOR
         MENUITEM "&Lock the Taskbar", ID_LOCKTASKBAR
         MENUITEM "P&roperties", ID_SHELL_CMD_PROPERTIES
     END
@@ -57,3 +61,8 @@
     IDS_OPEN_ALL_USERS    "O&pen All Users"
     IDS_EXPLORE_ALL_USERS "E&xplore All Users"
 END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_TASKBAR_STARTMENU_PROP_CAPTION "Taskbar and Start Menu Properties"
+END

Modified: trunk/reactos/base/shell/explorer-new/resource.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/resource.h?rev=41848&r1=41847&r2=41848&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer-new/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/resource.h [iso-8859-1] Fri Jul 10 21:10:20 2009
@@ -21,6 +21,7 @@
 #define ID_SHELL_CMD_OPEN_ALL_USERS (ID_SHELL_CMD_LAST + 2)
 #define ID_SHELL_CMD_EXPLORE_ALL_USERS  (ID_SHELL_CMD_LAST + 3)
 #define ID_LOCKTASKBAR  (ID_SHELL_CMD_LAST + 4)
+#define ID_SHELL_CMD_OPEN_TASKMGR (ID_SHELL_CMD_LAST + 5)
 
 /* NOTE: The following constants may *NOT* be changed because
          they're hardcoded and need to be the exact values
@@ -44,4 +45,12 @@
 #define IDM_SHUTDOWN 506
 #define IDM_LASTSTARTMENU_SEPARATOR 450
 
+/* Taskbar resources */
+#define IDD_TASKBARPAGE 2000
+#define IDD_STARTMENUPAGE 2001
+#define IDD_NOTIFICATIONPAGE 2002
+#define IDD_TOOLBARSPAGE 2003
+
+#define IDS_TASKBAR_STARTMENU_PROP_CAPTION 2200
+
 #endif /* __RESOURCE_H */

Modified: trunk/reactos/base/shell/explorer-new/trayprop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/trayprop.c?rev=41848&r1=41847&r2=41848&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer-new/trayprop.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/trayprop.c [iso-8859-1] Fri Jul 10 21:10:20 2009
@@ -20,10 +20,191 @@
 
 #include <precomp.h>
 
+INT_PTR CALLBACK
+TaskbarPageProc(HWND hwndDlg,
+                UINT uMsg,
+                WPARAM wParam,
+                LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_DESTROY:
+            break;
+
+        case WM_NOTIFY:
+        {
+            LPNMHDR pnmh = (LPNMHDR)lParam;
+
+            switch(pnmh->code)
+            {
+                case PSN_SETACTIVE:
+                    break;
+
+                case PSN_APPLY:
+                    break;
+            }
+
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
+
+INT_PTR CALLBACK
+StartMenuPageProc(HWND hwndDlg,
+                  UINT uMsg,
+                  WPARAM wParam,
+                  LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_DESTROY:
+            break;
+
+        case WM_NOTIFY:
+        {
+            LPNMHDR pnmh = (LPNMHDR)lParam;
+
+            switch(pnmh->code)
+            {
+                case PSN_SETACTIVE:
+                    break;
+
+                case PSN_APPLY:
+                    break;
+            }
+
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
+
+INT_PTR CALLBACK
+NotificationPageProc(HWND hwndDlg,
+                     UINT uMsg,
+                     WPARAM wParam,
+                     LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_DESTROY:
+            break;
+
+        case WM_NOTIFY:
+        {
+            LPNMHDR pnmh = (LPNMHDR)lParam;
+
+            switch(pnmh->code)
+            {
+                case PSN_SETACTIVE:
+                    break;
+
+                case PSN_APPLY:
+                    break;
+            }
+
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
+
+INT_PTR CALLBACK
+ToolbarsPageProc(HWND hwndDlg,
+                 UINT uMsg,
+                 WPARAM wParam,
+                 LPARAM lParam)
+{
+    switch (uMsg)
+    {
+        case WM_INITDIALOG:
+            break;
+
+        case WM_DESTROY:
+            break;
+
+        case WM_NOTIFY:
+        {
+            LPNMHDR pnmh = (LPNMHDR)lParam;
+
+            switch(pnmh->code)
+            {
+                case PSN_SETACTIVE:
+                    break;
+
+                case PSN_APPLY:
+                    break;
+            }
+
+            break;
+        }
+    }
+
+    return FALSE;
+}
+
+
+static VOID
+InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
+{
+    ZeroMemory(psp, sizeof(PROPSHEETPAGE));
+    psp->dwSize = sizeof(PROPSHEETPAGE);
+    psp->dwFlags = PSP_DEFAULT;
+    psp->hInstance = hExplorerInstance;
+    psp->pszTemplate = MAKEINTRESOURCE(idDlg);
+    psp->pfnDlgProc = DlgProc;
+}
+
+
 HWND
 DisplayTrayProperties(ITrayWindow *Tray)
 {
-    DbgPrint("DisplayTrayProperties() not implemented!\n");
+    PROPSHEETHEADER psh;
+    PROPSHEETPAGE psp[4];
+    TCHAR szCaption[256];
+#if 1
     MessageBox(NULL, _T("Not implemented"), NULL, 0);
     return NULL;
-}
+#endif
+    if (!LoadString(hExplorerInstance,
+                    IDS_TASKBAR_STARTMENU_PROP_CAPTION,
+                    szCaption,
+                    sizeof(szCaption) / sizeof(szCaption[0])))
+    {
+        return NULL;
+    }
+
+    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
+    psh.dwSize = sizeof(PROPSHEETHEADER);
+    psh.dwFlags =  PSH_PROPSHEETPAGE | PSH_PROPTITLE;
+    psh.hwndParent = NULL;
+    psh.hInstance = hExplorerInstance;
+    psh.hIcon = NULL;
+    psh.pszCaption = szCaption;
+    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
+    psh.nStartPage = 0;
+    psh.ppsp = psp;
+
+    InitPropSheetPage(&psp[0], IDD_TASKBARPAGE, (DLGPROC)TaskbarPageProc);
+    InitPropSheetPage(&psp[1], IDD_STARTMENUPAGE, (DLGPROC)StartMenuPageProc);
+    InitPropSheetPage(&psp[2], IDD_NOTIFICATIONPAGE, (DLGPROC)NotificationPageProc);
+    InitPropSheetPage(&psp[3], IDD_TOOLBARSPAGE, (DLGPROC)ToolbarsPageProc);
+
+    return (HWND)PropertySheet(&psh);
+}

Modified: trunk/reactos/base/shell/explorer-new/traywnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer-new/traywnd.c?rev=41848&r1=41847&r2=41848&view=diff
==============================================================================
--- trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer-new/traywnd.c [iso-8859-1] Fri Jul 10 21:10:20 2009
@@ -1697,6 +1697,17 @@
     }
 }
 
+static VOID
+OpenTaskManager(IN HWND hWndOwner)
+{
+    ShellExecute(hWndOwner,
+                 TEXT("open"),
+                 TEXT("taskmgr.exe"),
+                 NULL,
+                 NULL,
+                 SW_SHOWNORMAL);
+}
+
 static BOOL STDMETHODCALLTYPE
 ITrayWindowImpl_ExecContextMenuCmd(IN OUT ITrayWindow *iface,
                                    IN UINT uiCmd)
@@ -1727,6 +1738,11 @@
                                  !This->Locked);
             }
             break;
+
+        case ID_SHELL_CMD_OPEN_TASKMGR:
+            OpenTaskManager(This->hWnd);
+            break;
+
 
         default:
             DbgPrint("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);



More information about the Ros-diffs mailing list