mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 13:11:22 +00:00
[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).
This commit is contained in:
parent
02825c20e4
commit
2c80432268
14 changed files with 52 additions and 192 deletions
|
@ -2,7 +2,6 @@
|
|||
spec2def(umandlg.dll umandlg.spec)
|
||||
|
||||
add_library(umandlg MODULE
|
||||
about.c
|
||||
process.c
|
||||
registry.c
|
||||
umandlg.c
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue