From 359d3bc253052ade128f8dde845b80a028da7268 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 3 Apr 2005 11:23:03 +0000 Subject: [PATCH] display "log off" dialog, add "terminate" menu entry svn path=/trunk/; revision=14469 --- reactos/subsys/system/explorer/explorer-jp.rc | 1 + .../subsys/system/explorer/explorer_intres.h | 1 + .../subsys/system/explorer/explorer_intres.rc | 7 ++++ .../subsys/system/explorer/make_explorer.dsp | 4 --- .../system/explorer/taskbar/desktopbar.h | 1 + .../system/explorer/taskbar/startmenu.cpp | 32 ++++++++++++------- .../system/explorer/taskbar/startmenu.h | 6 ++-- 7 files changed, 35 insertions(+), 17 deletions(-) diff --git a/reactos/subsys/system/explorer/explorer-jp.rc b/reactos/subsys/system/explorer/explorer-jp.rc index 04da4647358..229169f28d4 100644 --- a/reactos/subsys/system/explorer/explorer-jp.rc +++ b/reactos/subsys/system/explorer/explorer-jp.rc @@ -290,6 +290,7 @@ BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "スタート" IDS_LOGOFF "ログオフ..." + IDS_TERMINATE "ログオフ" IDS_SHUTDOWN "シャットダウン..." IDS_LAUNCH "ファイル名を指定して実行..." IDS_START_HELP "ヘルプ" diff --git a/reactos/subsys/system/explorer/explorer_intres.h b/reactos/subsys/system/explorer/explorer_intres.h index 65019d11811..4bb9e8faf81 100644 --- a/reactos/subsys/system/explorer/explorer_intres.h +++ b/reactos/subsys/system/explorer/explorer_intres.h @@ -46,6 +46,7 @@ #define IDS_NOTIFY_AUTOHIDE 42 #define IDS_SHOW_HIDDEN_ICONS 43 #define IDS_HIDE_ICONS 44 +#define IDS_TERMINATE 45 #define IDI_REACTOS 100 #define IDI_EXPLORER 101 #define IDI_STARTMENU 102 diff --git a/reactos/subsys/system/explorer/explorer_intres.rc b/reactos/subsys/system/explorer/explorer_intres.rc index 15a75b6b08a..c52477216bc 100644 --- a/reactos/subsys/system/explorer/explorer_intres.rc +++ b/reactos/subsys/system/explorer/explorer_intres.rc @@ -126,6 +126,7 @@ BEGIN IDS_TITLE "ReactOS Explorer" IDS_START "ホncepe" IDS_LOGOFF "ホnchide sesiunea ..." + IDS_TERMINATE "ホnchide sesiunea" IDS_SHUTDOWN "Oprire calculator ..." IDS_LAUNCH "Pornire ..." IDS_START_HELP "Ajutor" @@ -583,6 +584,7 @@ BEGIN IDS_TITLE "Reactos Explorer" IDS_START "Start" IDS_LOGOFF "Abmelden..." + IDS_TERMINATE "ROS Explorer beenden" IDS_SHUTDOWN "Herunterfahren..." IDS_LAUNCH "Starten..." IDS_START_HELP "Hilfe" @@ -1075,6 +1077,7 @@ BEGIN IDS_TITLE "Reactos Explorer" IDS_START "Start" IDS_LOGOFF "Log Off..." + IDS_TERMINATE "Terminate ROS Explorer" IDS_SHUTDOWN "Turn Off..." IDS_LAUNCH "Run..." IDS_START_HELP "Help" @@ -1538,6 +1541,7 @@ BEGIN IDS_TITLE "Reactos Explorer" IDS_START "Iniciar" IDS_LOGOFF "Salir..." + IDS_TERMINATE "Salir" IDS_SHUTDOWN "Apagar..." IDS_LAUNCH "Ejecutar..." IDS_START_HELP "Ayuda" @@ -1708,6 +1712,7 @@ BEGIN IDS_TITLE "Explorateur Reactos" IDS_START "D駑arrer" IDS_LOGOFF "D馗onnexion ..." + IDS_TERMINATE "D馗onnexion" IDS_SHUTDOWN "Arr黎er..." IDS_LAUNCH "Ex馗uter..." IDS_START_HELP "Aide" @@ -1921,6 +1926,7 @@ BEGIN IDS_TITLE "Explorador do Reactos" IDS_START "Iniciar" IDS_LOGOFF "Terminar sess縊..." + IDS_TERMINATE "Terminar" IDS_SHUTDOWN "Desligar..." IDS_LAUNCH "Executar..." IDS_START_HELP "Ajuda" @@ -2412,6 +2418,7 @@ BEGIN IDS_TITLE "Reactos Explorer" IDS_START "Start" IDS_LOGOFF "Logga ut..." + IDS_TERMINATE "Logga ut" IDS_SHUTDOWN "St舅g av..." IDS_LAUNCH "Kr..." IDS_START_HELP "Hj舁p" diff --git a/reactos/subsys/system/explorer/make_explorer.dsp b/reactos/subsys/system/explorer/make_explorer.dsp index ac74928ae8c..ad364110d4d 100644 --- a/reactos/subsys/system/explorer/make_explorer.dsp +++ b/reactos/subsys/system/explorer/make_explorer.dsp @@ -183,10 +183,6 @@ CFG=make_explorer - Win32 bjam # Begin Source File -SOURCE=..\..\..\ChangeLog -# End Source File -# Begin Source File - SOURCE=.\Jamfile # End Source File # Begin Source File diff --git a/reactos/subsys/system/explorer/taskbar/desktopbar.h b/reactos/subsys/system/explorer/taskbar/desktopbar.h index d5c067c4afb..6a3f017b14d 100644 --- a/reactos/subsys/system/explorer/taskbar/desktopbar.h +++ b/reactos/subsys/system/explorer/taskbar/desktopbar.h @@ -56,6 +56,7 @@ #define IDC_BROWSE 0x1014 #define IDC_SEARCH_PROGRAM 0x1015 #define IDC_SEARCH 0x1016 +#define IDC_TERMINATE 0x1017 #define IDC_FIRST_MENU 0x3000 diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.cpp b/reactos/subsys/system/explorer/taskbar/startmenu.cpp index 40e498f8b40..b860076f02f 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.cpp +++ b/reactos/subsys/system/explorer/taskbar/startmenu.cpp @@ -1690,6 +1690,9 @@ LRESULT StartMenuRoot::Init(LPCREATESTRUCT pcs) AddButton(ResString(IDS_SHUTDOWN), ICID_LOGOFF, false, IDC_SHUTDOWN); + AddButton(ResString(IDS_TERMINATE), ICID_LOGOFF, false, IDC_TERMINATE); + + #ifdef __MINGW32__ RegCloseKey(hkeyAdv); RegCloseKey(hkey); @@ -1830,9 +1833,11 @@ int StartMenuHandler::Command(int id, int code) break; case IDC_LOGOFF: - /* The shell32 Dialog prompts about some system setting change. This is not what we want to display here. CloseStartMenu(id); - ShowRestartDialog(g_Globals._hwndDesktopBar, EWX_LOGOFF);*/ + ShowLogoffDialog(g_Globals._hwndDesktopBar, EWX_LOGOFF); + break; + + case IDC_TERMINATE: DestroyWindow(GetParent(_hwnd)); break; @@ -1974,24 +1979,29 @@ void StartMenuHandler::ShowLaunchDialog(HWND hwndOwner) } } -void StartMenuHandler::ShowRestartDialog(HWND hwndOwner, UINT flags) +void StartMenuHandler::ShowLogoffDialog(HWND hwndOwner, UINT flags) { - static DynamicFct RestartDlg(TEXT("SHELL32"), 59); + static DynamicFct LogoffWindowsDialog(TEXT("SHELL32"), 54); +// static DynamicFct RestartDialog(TEXT("SHELL32"), 59); - if (RestartDlg) - (*RestartDlg)(hwndOwner, (LPWSTR)L"You selected .\n\n", flags); ///@todo ANSI string conversion if needed + if (LogoffWindowsDialog) + (*LogoffWindowsDialog)(0); +/* The RestartDialog function prompts about some system setting change. This is not what we want to display here. + else if (RestartDialog) + return (*RestartDialog)(hwndOwner, (LPWSTR)L"You selected .\n\n", flags) == 1; ///@todo ANSI string conversion if needed +*/ else - MessageBox(hwndOwner, TEXT("RestartDlg() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK); + MessageBox(hwndOwner, TEXT("LogoffWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK); } void ShowExitWindowsDialog(HWND hwndOwner) { - static DynamicFct ExitWindowsDlg(TEXT("SHELL32"), 60); + static DynamicFct ExitWindowsDialog(TEXT("SHELL32"), 60); - if (ExitWindowsDlg) - (*ExitWindowsDlg)(hwndOwner); + if (ExitWindowsDialog) + (*ExitWindowsDialog)(hwndOwner); else - MessageBox(hwndOwner, TEXT("ExitWindowsDlg() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK); + MessageBox(hwndOwner, TEXT("ExitWindowsDialog() not yet implemented in SHELL32"), ResString(IDS_TITLE), MB_OK); } diff --git a/reactos/subsys/system/explorer/taskbar/startmenu.h b/reactos/subsys/system/explorer/taskbar/startmenu.h index 21bb72d31af..67b2b6310f6 100644 --- a/reactos/subsys/system/explorer/taskbar/startmenu.h +++ b/reactos/subsys/system/explorer/taskbar/startmenu.h @@ -321,9 +321,11 @@ typedef void (WINAPI* RUNFILEDLG)(HWND hwndOwner, HICON hIcon, LPCSTR lpstrDirec #define RFF_NOSEPARATEMEM 0x20 // Removes the Separate Memory Space check box (Windows NT only). - // declare more undocumented shell32 functions + // declare more previously undocumented shell32 functions typedef void (WINAPI* EXITWINDOWSDLG)(HWND hwndOwner); +typedef int (WINAPI* LOGOFFWINDOWSDIALOG)(UINT flags); typedef int (WINAPI* RESTARTWINDOWSDLG)(HWND hwndOwner, LPCWSTR reason, UINT flags); +typedef int (WINAPI* RESTARTWINDOWSDLGEX)(HWND hWndOwner, LPCWSTR lpwstrReason, DWORD uFlags, DWORD uReason); typedef BOOL (WINAPI* SHFINDFILES)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch); typedef BOOL (WINAPI* SHFINDCOMPUTER)(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch); @@ -347,7 +349,7 @@ protected: int Command(int id, int code); static void ShowLaunchDialog(HWND hwndOwner); - static void ShowRestartDialog(HWND hwndOwner, UINT flags); + static void ShowLogoffDialog(HWND hwndOwner, UINT flags); static void ShowSearchDialog(); static void ShowSearchComputer(); };