Implement Utility Manager software
[reactos.git] / base / applications / utilman / about.c
1 /*
2 * PROJECT: ReactOS Utility Manager (Accessibility)
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: About dialog file
5 * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com)
6 */
7
8 /* INCLUDES *******************************************************************/
9
10 #include "precomp.h"
11
12 /* GLOBALS ********************************************************************/
13
14 UTILMAN_GLOBALS Globals;
15
16 /* FUNCTIONS ******************************************************************/
17
18 /**
19 * @AboutDlgProc
20 *
21 * "About" dialog procedure.
22 *
23 * @param hDlg
24 * The handle object of the dialog.
25 *
26 * @param Msg
27 * Message events (in unsigned int).
28 *
29 * @param wParam
30 * Message parameter (in UINT_PTR).
31 *
32 * @param lParam
33 * Message paramater (in LONG_PTR).
34 *
35 * @return
36 * Return TRUE if the dialog processed messages,
37 * FALSE otherwise.
38 *
39 */
40 INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
41 {
42 switch (Msg)
43 {
44 case WM_INITDIALOG:
45 {
46 Globals.hIcon = LoadImageW(Globals.hInstance,
47 MAKEINTRESOURCEW(IDI_ICON_UTILMAN),
48 IMAGE_ICON,
49 0,
50 0,
51 LR_DEFAULTSIZE);
52
53 /* Set the icon within the dialog's title bar */
54 if (Globals.hIcon)
55 {
56 SendMessageW(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)Globals.hIcon);
57 }
58
59 return TRUE;
60 }
61
62 case WM_COMMAND:
63 {
64 case IDOK:
65 case IDCANCEL:
66 DestroyIcon(Globals.hIcon);
67 EndDialog(hDlg, FALSE);
68 break;
69 }
70 }
71
72 return FALSE;
73 }
74
75 /**
76 * @ShowAboutDlg
77 *
78 * Display the "About" dialog.
79 *
80 * @param hDlgParent
81 * The handle object of the parent dialog.
82 *
83 * @return
84 * Nothing.
85 */
86 VOID ShowAboutDlg(HWND hDlgParent)
87 {
88 /* Display the "About" dialog when the user clicks on the "About" menu item */
89 DialogBoxW(Globals.hInstance,
90 MAKEINTRESOURCEW(IDD_ABOUT_DIALOG),
91 hDlgParent,
92 AboutDlgProc);
93 }