diff --git a/reactos/base/shell/explorer-new/lang/en-US.rc b/reactos/base/shell/explorer-new/lang/en-US.rc index 925640b9fd3..550777fdd23 100644 --- a/reactos/base/shell/explorer-new/lang/en-US.rc +++ b/reactos/base/shell/explorer-new/lang/en-US.rc @@ -4,6 +4,10 @@ IDM_TRAYWND MENU DISCARDABLE 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 @@ BEGIN 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 diff --git a/reactos/base/shell/explorer-new/resource.h b/reactos/base/shell/explorer-new/resource.h index 51702212ba6..c2af9abbcc2 100644 --- a/reactos/base/shell/explorer-new/resource.h +++ b/reactos/base/shell/explorer-new/resource.h @@ -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 */ diff --git a/reactos/base/shell/explorer-new/trayprop.c b/reactos/base/shell/explorer-new/trayprop.c index d412bef8dc5..0783ab648ab 100644 --- a/reactos/base/shell/explorer-new/trayprop.c +++ b/reactos/base/shell/explorer-new/trayprop.c @@ -20,10 +20,191 @@ #include +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); } diff --git a/reactos/base/shell/explorer-new/traywnd.c b/reactos/base/shell/explorer-new/traywnd.c index 4e8438fa941..7af0c06d2aa 100644 --- a/reactos/base/shell/explorer-new/traywnd.c +++ b/reactos/base/shell/explorer-new/traywnd.c @@ -1697,6 +1697,17 @@ OpenCommonStartMenuDirectory(IN HWND hWndOwner, } } +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) @@ -1728,6 +1739,11 @@ ITrayWindowImpl_ExecContextMenuCmd(IN OUT ITrayWindow *iface, } break; + case ID_SHELL_CMD_OPEN_TASKMGR: + OpenTaskManager(This->hWnd); + break; + + default: DbgPrint("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd); bHandled = FALSE;