https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c804322686fb9ca7a57df...
commit 2c804322686fb9ca7a57df21769ba8b6157e9138 Author: George Bișoc fraizeraust99@gmail.com AuthorDate: Thu May 7 13:01:36 2020 +0200 Commit: GitHub noreply@github.com CommitDate: Thu May 7 13:01:36 2020 +0200
[UTILMAN] Use the ShellAboutW API routine to display the about dialog (#2743)
In addition to that, add the missing function prototypes in the DLL dialog header of Utilman, add missing IN/OUT annotations and remove CheckUtilityState() prototype which is barely used (it's not implemented either). --- base/applications/utilman/umandlg/CMakeLists.txt | 1 - base/applications/utilman/umandlg/about.c | 92 ------------------------ base/applications/utilman/umandlg/lang/en-US.rc | 12 +--- base/applications/utilman/umandlg/lang/es-ES.rc | 12 +--- base/applications/utilman/umandlg/lang/fr-FR.rc | 12 +--- base/applications/utilman/umandlg/lang/he-IL.rc | 12 +--- base/applications/utilman/umandlg/lang/it-IT.rc | 12 +--- base/applications/utilman/umandlg/lang/pl-PL.rc | 12 +--- base/applications/utilman/umandlg/lang/ro-RO.rc | 12 +--- base/applications/utilman/umandlg/lang/ru-RU.rc | 12 +--- base/applications/utilman/umandlg/lang/uk-UA.rc | 12 +--- base/applications/utilman/umandlg/resource.h | 5 +- base/applications/utilman/umandlg/umandlg.c | 25 ++++++- base/applications/utilman/umandlg/umandlg.h | 13 ++-- 14 files changed, 52 insertions(+), 192 deletions(-)
diff --git a/base/applications/utilman/umandlg/CMakeLists.txt b/base/applications/utilman/umandlg/CMakeLists.txt index e2b0a0a9e4b..91ae1067166 100644 --- a/base/applications/utilman/umandlg/CMakeLists.txt +++ b/base/applications/utilman/umandlg/CMakeLists.txt @@ -2,7 +2,6 @@ spec2def(umandlg.dll umandlg.spec)
add_library(umandlg MODULE - about.c process.c registry.c umandlg.c diff --git a/base/applications/utilman/umandlg/about.c b/base/applications/utilman/umandlg/about.c deleted file mode 100644 index ea66987296a..00000000000 --- a/base/applications/utilman/umandlg/about.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * PROJECT: ReactOS Utility Manager Resources DLL (UManDlg.dll) - * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) - * PURPOSE: About dialog file - * COPYRIGHT: Copyright 2019-2020 Bișoc George (fraizeraust99 at gmail dot com) - */ - -/* INCLUDES *******************************************************************/ - -#include "umandlg.h" - -/* GLOBALS ********************************************************************/ - -UTILMAN_GLOBALS Globals; - -/* FUNCTIONS ******************************************************************/ - -/** - * @AboutDlgProc - * - * "About" dialog procedure. - * - * @param hDlg - * The handle object of the dialog. - * - * @param Msg - * Message events (in unsigned int). - * - * @param wParam - * Message parameter (in UINT_PTR). - * - * @param lParam - * Message paramater (in LONG_PTR). - * - * @return - * Return TRUE if the dialog processed messages, - * FALSE otherwise. - * - */ -INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) -{ - switch (Msg) - { - case WM_INITDIALOG: - { - WCHAR szAppPath[MAX_BUFFER]; - - /* Extract the icon resource from the executable process */ - GetModuleFileNameW(NULL, szAppPath, _countof(szAppPath)); - Globals.hIcon = ExtractIconW(Globals.hInstance, szAppPath, 0); - - /* Set the icon within the dialog's title bar */ - if (Globals.hIcon) - { - SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hIcon); - } - - return TRUE; - } - - case WM_COMMAND: - { - case IDOK: - case IDCANCEL: - DestroyIcon(Globals.hIcon); - EndDialog(hDlg, FALSE); - break; - } - } - - return FALSE; -} - -/** - * @ShowAboutDlg - * - * Display the "About" dialog. - * - * @param hDlgParent - * The handle object of the parent dialog. - * - * @return - * Nothing. - */ -VOID ShowAboutDlg(HWND hDlgParent) -{ - /* Display the "About" dialog when the user clicks on the "About" menu item */ - DialogBoxW(Globals.hInstance, - MAKEINTRESOURCEW(IDD_ABOUT_DIALOG), - hDlgParent, - AboutDlgProc); -} diff --git a/base/applications/utilman/umandlg/lang/en-US.rc b/base/applications/utilman/umandlg/lang/en-US.rc index dcaa3a2395d..d44bc44cd3a 100644 --- a/base/applications/utilman/umandlg/lang/en-US.rc +++ b/base/applications/utilman/umandlg/lang/en-US.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&Help", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "About Accessibility Utility Manager" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Accessibility Utility Manager\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Close", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "On-Screen Keyboard" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "About Accessibility Utility Manager..." + IDS_APP_NAME "Accessibility Utility Manager" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/es-ES.rc b/base/applications/utilman/umandlg/lang/es-ES.rc index 8b7ade86373..bbf3e57d57c 100644 --- a/base/applications/utilman/umandlg/lang/es-ES.rc +++ b/base/applications/utilman/umandlg/lang/es-ES.rc @@ -26,16 +26,6 @@ BEGIN CONTROL "&Ayuda", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "Acerca de las Herramientas de Accesibilidad" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Accessibility Utility Manager\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Cerrar", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Teclado en Pantalla" @@ -52,4 +42,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "Acerca de las Herramientas de Accesibilidad..." + IDS_APP_NAME "Herramientas de Accesibilidad" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/fr-FR.rc b/base/applications/utilman/umandlg/lang/fr-FR.rc index 71368f2c0d2..d80ebc05235 100644 --- a/base/applications/utilman/umandlg/lang/fr-FR.rc +++ b/base/applications/utilman/umandlg/lang/fr-FR.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&Aide", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "A propos du gestionnaire d'utilitaires d'accessibilité" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Accessibility Utility Manager\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Close", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Clavier visuel" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "A propos du gestionnaire d'utilitaires d'accessibilité..." + IDS_APP_NAME "Gestionnaire d'utilitaires d'accessibilité" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/he-IL.rc b/base/applications/utilman/umandlg/lang/he-IL.rc index 4f381ba3530..f9f918222e0 100644 --- a/base/applications/utilman/umandlg/lang/he-IL.rc +++ b/base/applications/utilman/umandlg/lang/he-IL.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&עזרה", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "אודות מנהל כלי הנגישות" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "מנהל כלי הנגישות\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "סגור", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "לוח מקשים על התצוגה" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "אודות מנהל כלי הנגישות..." + IDS_APP_NAME "מנהל כלי הנגישות" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/it-IT.rc b/base/applications/utilman/umandlg/lang/it-IT.rc index b36ec0577e7..a8ba5478ea4 100644 --- a/base/applications/utilman/umandlg/lang/it-IT.rc +++ b/base/applications/utilman/umandlg/lang/it-IT.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "?", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "Informazioni su Accessibilità Utility Manager" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Accessibilità Utility Manager\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Chiudi", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Tastiera su schermo" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "Informazioni su Accessibilità Utility Manager..." + IDS_APP_NAME "Accessibilità Utility Manager" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/pl-PL.rc b/base/applications/utilman/umandlg/lang/pl-PL.rc index 76d82e75514..10a9d042d9d 100644 --- a/base/applications/utilman/umandlg/lang/pl-PL.rc +++ b/base/applications/utilman/umandlg/lang/pl-PL.rc @@ -24,16 +24,6 @@ BEGIN CONTROL "&Pomoc", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "Menedżer narzędzi ułatwienia dostępu - informacje" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Menedżer narzędzi ułatwienia dostępu\nCopyright 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Copyright 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Close", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Klawiatura ekranowa" @@ -50,4 +40,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "O programie Menedżer narzędzi ułatwienia dostępu..." + IDS_APP_NAME "Menedżer narzędzi ułatwienia dostępu" + IDS_AUTHORS "Copyright 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/ro-RO.rc b/base/applications/utilman/umandlg/lang/ro-RO.rc index 5cb51134aa2..10f357e9eba 100644 --- a/base/applications/utilman/umandlg/lang/ro-RO.rc +++ b/base/applications/utilman/umandlg/lang/ro-RO.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&Ajutor", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "Despre Managerul utilitare" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Manager utilitare\nDrept de autor 2019 George Bișoc (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "Drept de autor 2019 Hermes Belusca-Maito", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "Închide", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Tastatură virtuală" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "Despre Managerul utilitare..." + IDS_APP_NAME "Manager utilitare" + IDS_AUTHORS "Drept de autor 2019 George Bișoc, Hermes Belusca-Maito" END diff --git a/base/applications/utilman/umandlg/lang/ru-RU.rc b/base/applications/utilman/umandlg/lang/ru-RU.rc index c57d4be4169..a797b13c517 100644 --- a/base/applications/utilman/umandlg/lang/ru-RU.rc +++ b/base/applications/utilman/umandlg/lang/ru-RU.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&Справка", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "О программе" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Диспетчер служебных программ\n© 2019 Джордж Бисок (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "© 2019 Гермес Белуска-Майто", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "OK", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Экранная клавиатура" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "О программе" + IDS_APP_NAME "Диспетчер служебных программ" + IDS_AUTHORS "© 2019 Джордж Бисок, Гермес Белуска-Майто" END diff --git a/base/applications/utilman/umandlg/lang/uk-UA.rc b/base/applications/utilman/umandlg/lang/uk-UA.rc index d13c862c279..0ce31dc1aba 100644 --- a/base/applications/utilman/umandlg/lang/uk-UA.rc +++ b/base/applications/utilman/umandlg/lang/uk-UA.rc @@ -25,16 +25,6 @@ BEGIN CONTROL "&Довідка", IDC_HELP_TOPICS, "Button", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_TABSTOP, 98, 161, 50, 14 END
-IDD_ABOUT_DIALOG DIALOGEX 22, 16, 210, 65 -CAPTION "Про программу" -FONT 8, "MS Shell Dlg", 0, 0 -STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -BEGIN - LTEXT "Диспетчер службових програм\n© 2019 Джордж Бісок (fraizeraust99 at gmail dot com)", IDC_STATIC, 10, 7, 150, 36 - LTEXT "© 2019 Гермес Белуска-Майто", IDC_STATIC, 10, 33, 150, 36 - PUSHBUTTON "OK", IDOK, 75, 47, 44, 15 -END - STRINGTABLE BEGIN IDS_OSK "Екранна клавіатура" @@ -51,4 +41,6 @@ END STRINGTABLE BEGIN IDM_ABOUT "Про программу" + IDS_APP_NAME "Диспетчер службових програм" + IDS_AUTHORS "© 2019 Джордж Бісок, Гермес Белуска-Майто" END diff --git a/base/applications/utilman/umandlg/resource.h b/base/applications/utilman/umandlg/resource.h index d980b983a7e..5d04ba3c1c7 100644 --- a/base/applications/utilman/umandlg/resource.h +++ b/base/applications/utilman/umandlg/resource.h @@ -39,6 +39,9 @@ /* System menu (About) resource */ #define IDM_ABOUT 600
+/* About resource strings */ +#define IDS_APP_NAME 700 +#define IDS_AUTHORS 701 + /* Main dialog resource */ #define IDD_MAIN_DIALOG 1000 -#define IDD_ABOUT_DIALOG 1050 diff --git a/base/applications/utilman/umandlg/umandlg.c b/base/applications/utilman/umandlg/umandlg.c index 0902f3b972f..f1a9a72ce67 100644 --- a/base/applications/utilman/umandlg/umandlg.c +++ b/base/applications/utilman/umandlg/umandlg.c @@ -35,7 +35,7 @@ UTILMAN_STATE EntriesList[] = * @return * Nothing. */ -VOID InitUtilsList(BOOL bInitGui) +VOID InitUtilsList(IN BOOL bInitGui) { UINT i;
@@ -152,6 +152,29 @@ BOOL DlgInitHandler(IN HWND hDlg) return TRUE; }
+/** + * @ShowAboutDlg + * + * Displays the Shell "About" dialog box. + * + * @param[in] hDlgParent + * A handle to the parent dialog window. + * + * @return + * Nothing. + * + */ +VOID ShowAboutDlg(IN HWND hDlgParent) +{ + WCHAR szApp[MAX_BUFFER]; + WCHAR szAuthors[MAX_BUFFER]; + + LoadStringW(Globals.hInstance, IDS_APP_NAME, szApp, _countof(szApp)); + LoadStringW(Globals.hInstance, IDS_AUTHORS, szAuthors, _countof(szAuthors)); + + ShellAboutW(hDlgParent, szApp, szAuthors, Globals.hIcon); +} + /** * @GroupBoxUpdateTitle * diff --git a/base/applications/utilman/umandlg/umandlg.h b/base/applications/utilman/umandlg/umandlg.h index 6705761239b..b7548cc972e 100644 --- a/base/applications/utilman/umandlg/umandlg.h +++ b/base/applications/utilman/umandlg/umandlg.h @@ -90,10 +90,13 @@ typedef enum _WRITE_REGISTRY /* DECLARATIONS ***************************************************************/
/* umandlg.c */ -BOOL DlgInitHandler(HWND hDlg); -INT_PTR APIENTRY DlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); +VOID InitUtilsList(IN BOOL bInitGui); +BOOL DlgInitHandler(IN HWND hDlg); +VOID ShowAboutDlg(IN HWND hDlgParent); +VOID GroupBoxUpdateTitle(VOID); +VOID UpdateUtilityState(IN BOOL bUtilState); +INT_PTR APIENTRY DlgProc(IN HWND hDlg, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam); INT ListBoxRefreshContents(VOID); -VOID CheckUtilityState(BOOL bUtilState); BOOL WINAPI UManStartDlg(VOID);
/* process.c */ @@ -102,10 +105,6 @@ BOOL IsProcessRunning(IN LPCWSTR lpszProcessName); BOOL LaunchProcess(IN LPCWSTR lpszProcessName); BOOL CloseProcess(IN LPCWSTR lpszProcessName);
-/* about.c */ -VOID ShowAboutDlg(HWND hDlgParent); -INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); - /* registry.c */ BOOL InitAppRegKey(IN HKEY hPredefinedKey, IN LPCWSTR lpszSubKey, OUT PHKEY phKey, OUT LPDWORD lpdwDisposition); BOOL QueryAppSettings(IN HKEY hKey, IN LPCWSTR lpszSubKey, IN LPCWSTR lpszRegValue, OUT PVOID ReturnedData, IN OUT LPDWORD lpdwSizeData);