https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c994ba79d12264cf917a1…
commit c994ba79d12264cf917a1fb9b995dfa64e91eb46
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Thu Sep 15 15:56:31 2022 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Sep 15 16:56:31 2022 +0300
[MMC] Implement standard "About" menu action (#4639)
Reviewed-by: Serge Gautherie <reactos-git_serge_171003(a)gautherie.fr>
Reviewed-by: Mark Jansen <mark.jansen(a)reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez(a)gmail.com>
---
base/applications/mmc/console.c | 11 +++++++++++
base/applications/mmc/misc.c | 3 +--
base/applications/mmc/precomp.h | 5 +++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/base/applications/mmc/console.c b/base/applications/mmc/console.c
index a9fc833c401..6146273d996 100644
--- a/base/applications/mmc/console.c
+++ b/base/applications/mmc/console.c
@@ -18,6 +18,7 @@
*/
#include "precomp.h"
+#include <shellapi.h>
#include <stdlib.h>
#include <strsafe.h>
@@ -311,6 +312,7 @@ FrameOnCommand(HWND hwnd,
{
PCONSOLE_MAINFRAME_WND Info;
HWND hChild;
+ LPTSTR lpTitle;
Info = (PCONSOLE_MAINFRAME_WND)GetWindowLongPtr(hwnd, 0);
@@ -334,6 +336,15 @@ FrameOnCommand(HWND hwnd,
PostMessage(hwnd, WM_CLOSE, 0, 0);
break;
+ case IDM_HELP_ABOUT:
+ if (AllocAndLoadString(&lpTitle, hAppInstance, IDS_APPTITLE))
+ {
+ ShellAbout(hwnd, lpTitle, NULL,
+ LoadIcon(hAppInstance, MAKEINTRESOURCE(IDI_MAINAPP)));
+ LocalFree(lpTitle);
+ }
+ break;
+
default:
if (LOWORD(wParam) >= IDM_MDI_FIRSTCHILD)
{
diff --git a/base/applications/mmc/misc.c b/base/applications/mmc/misc.c
index 0174b9725a6..111787727bd 100644
--- a/base/applications/mmc/misc.c
+++ b/base/applications/mmc/misc.c
@@ -55,8 +55,7 @@ LengthOfStrResource(IN HINSTANCE hInst,
return -1;
}
-
-static INT
+INT
AllocAndLoadString(OUT LPTSTR *lpTarget,
IN HINSTANCE hInst,
IN UINT uID)
diff --git a/base/applications/mmc/precomp.h b/base/applications/mmc/precomp.h
index e96cb520ea0..6622dca6b63 100644
--- a/base/applications/mmc/precomp.h
+++ b/base/applications/mmc/precomp.h
@@ -32,6 +32,11 @@ INT
LengthOfStrResource(IN HINSTANCE hInst,
IN UINT uID);
+INT
+AllocAndLoadString(OUT LPTSTR *lpTarget,
+ IN HINSTANCE hInst,
+ IN UINT uID);
+
DWORD
LoadAndFormatString(IN HINSTANCE hInstance,
IN UINT uID,