Merge trunk HEAD (46152)
[reactos.git] / reactos / base / applications / calc / about.c
1 #include "calc.h"
2
3 #define MAX_LICENSE_SIZE 1000 // it's enought!
4
5 INT_PTR CALLBACK AboutDlgProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
6 {
7 TCHAR *license;
8
9 switch (msg) {
10 case WM_INITDIALOG:
11 license = (TCHAR *)alloca(MAX_LICENSE_SIZE*sizeof(TCHAR));
12 if (LoadString(calc.hInstance, IDS_STRING_LICENSE, license, MAX_LICENSE_SIZE))
13 SendDlgItemMessage(hWnd, IDC_EDIT_LICENSE, WM_SETTEXT, 0, (LPARAM)license);
14 /* Update software version */
15 SendDlgItemMessage(hWnd, IDC_TEXT_VERSION, WM_GETTEXT, (WPARAM)MAX_LICENSE_SIZE, (LPARAM)license);
16 _tcscat(license, CALC_VERSION);
17 SendDlgItemMessage(hWnd, IDC_TEXT_VERSION, WM_SETTEXT, 0, (LPARAM)license);
18 return TRUE;
19 case WM_COMMAND:
20 switch (LOWORD(wp)) {
21 case IDOK:
22 EndDialog(hWnd, 0);
23 return TRUE;
24 }
25 break;
26
27 case WM_CLOSE:
28 EndDialog(hWnd, 0);
29 return 0;
30 }
31 return FALSE;
32 }
33