sync with trunk r47346
[reactos.git] / base / applications / charmap / about.c
1 /*
2 * PROJECT: ReactOS Character Map
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/applications/charmap/about.c
5 * PURPOSE: about dialog
6 * COPYRIGHT: Copyright 2007 Ged Murphy <gedmurphy@reactos.org>
7 *
8 */
9
10
11 #include <precomp.h>
12
13
14 static
15 INT_PTR
16 CALLBACK
17 AboutDialogProc(HWND hDlg,
18 UINT message,
19 WPARAM wParam,
20 LPARAM lParam)
21 {
22 static HICON hIcon = NULL;
23
24 switch (message)
25 {
26 case WM_INITDIALOG:
27 {
28 HWND hLicenseEditWnd;
29 WCHAR strLicense[700];
30
31 hIcon = LoadImageW(hInstance,
32 MAKEINTRESOURCEW(IDI_ICON),
33 IMAGE_ICON,
34 16,
35 16,
36 0);
37 if (hIcon)
38 {
39 SendMessageW(hDlg,
40 WM_SETICON,
41 ICON_SMALL,
42 (LPARAM)hIcon);
43 }
44
45 hLicenseEditWnd = GetDlgItem(hDlg,
46 IDC_LICENSE_EDIT);
47
48 if (LoadStringW(hInstance,
49 IDS_LICENSE,
50 strLicense,
51 sizeof(strLicense) / sizeof(WCHAR)))
52 {
53 SetWindowTextW(hLicenseEditWnd,
54 strLicense);
55 }
56
57 return TRUE;
58 }
59
60 case WM_COMMAND:
61 {
62 if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
63 {
64 DestroyIcon(hIcon);
65 EndDialog(hDlg,
66 LOWORD(wParam));
67 return TRUE;
68 }
69
70 break;
71 }
72 }
73
74 return FALSE;
75 }
76
77
78 VOID
79 ShowAboutDlg(HWND hWndParent)
80 {
81 DialogBoxW(hInstance,
82 MAKEINTRESOURCEW(IDD_ABOUTBOX),
83 hWndParent,
84 AboutDialogProc);
85 }