reactos/base/applications/utilman/umandlg/about.c
Bișoc George e4f70e5434
[UTILMAN] Properly annotate some variables (#2561)
Previously the code had a mixture of 'sz', 'wsz', 'lp' and 'lpwsz' Hungarian annotation prefixes which could bring confusions about the nature of the annotated variables. From now on all of these variables have a well defined annotation. Furthermore, add a missing argument annotation to LaunchProcess().
2020-04-26 14:14:17 +02:00

93 lines
2.2 KiB
C

/*
* 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);
}