mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:53:09 +00:00
store license on heap and add some error checking
svn path=/trunk/; revision=21481
This commit is contained in:
parent
0b431b1a96
commit
0574d19c65
1 changed files with 16 additions and 13 deletions
|
@ -84,7 +84,7 @@ AboutDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
HWND hLicenseEditWnd;
|
HWND hLicenseEditWnd;
|
||||||
HICON hIcon = NULL;
|
HICON hIcon = NULL;
|
||||||
TCHAR strLicense[700];
|
static LPTSTR lpLicense = NULL;
|
||||||
|
|
||||||
switch (message)
|
switch (message)
|
||||||
{
|
{
|
||||||
|
@ -96,27 +96,30 @@ AboutDialogProc(HWND hDlg,
|
||||||
16,
|
16,
|
||||||
16,
|
16,
|
||||||
0);
|
0);
|
||||||
|
if (hIcon != NULL)
|
||||||
SendMessage(hDlg,
|
{
|
||||||
WM_SETICON,
|
SendMessage(hDlg,
|
||||||
ICON_SMALL,
|
WM_SETICON,
|
||||||
(LPARAM)hIcon);
|
ICON_SMALL,
|
||||||
|
(LPARAM)hIcon);
|
||||||
|
}
|
||||||
|
|
||||||
hLicenseEditWnd = GetDlgItem(hDlg,
|
hLicenseEditWnd = GetDlgItem(hDlg,
|
||||||
IDC_LICENSE_EDIT);
|
IDC_LICENSE_EDIT);
|
||||||
|
|
||||||
LoadString(hInstance,
|
if (AllocAndLoadString(&lpLicense,
|
||||||
IDS_LICENSE,
|
hInstance,
|
||||||
strLicense,
|
IDS_LICENSE))
|
||||||
sizeof(strLicense) / sizeof(TCHAR));
|
{
|
||||||
|
SetWindowText(hLicenseEditWnd,
|
||||||
SetWindowText(hLicenseEditWnd,
|
lpLicense);
|
||||||
strLicense);
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||||
{
|
{
|
||||||
|
LocalFree((HLOCAL)lpLicense);
|
||||||
DestroyIcon(hIcon);
|
DestroyIcon(hIcon);
|
||||||
EndDialog(hDlg,
|
EndDialog(hDlg,
|
||||||
LOWORD(wParam));
|
LOWORD(wParam));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue