[MMC] Implement standard "About" menu action (#4639)

Reviewed-by: Serge Gautherie <reactos-git_serge_171003@gautherie.fr>
Reviewed-by: Mark Jansen <mark.jansen@reactos.org>
Reviewed-by: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
Kyle Katarn 2022-09-15 15:56:31 +02:00 committed by GitHub
parent 67d063cbc8
commit c994ba79d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 2 deletions

View file

@ -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)
{

View file

@ -55,8 +55,7 @@ LengthOfStrResource(IN HINSTANCE hInst,
return -1;
}
static INT
INT
AllocAndLoadString(OUT LPTSTR *lpTarget,
IN HINSTANCE hInst,
IN UINT uID)

View file

@ -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,