mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 16:35:49 +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;
|
||||
HICON hIcon = NULL;
|
||||
TCHAR strLicense[700];
|
||||
static LPTSTR lpLicense = NULL;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
|
@ -96,27 +96,30 @@ AboutDialogProc(HWND hDlg,
|
|||
16,
|
||||
16,
|
||||
0);
|
||||
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
if (hIcon != NULL)
|
||||
{
|
||||
SendMessage(hDlg,
|
||||
WM_SETICON,
|
||||
ICON_SMALL,
|
||||
(LPARAM)hIcon);
|
||||
}
|
||||
|
||||
hLicenseEditWnd = GetDlgItem(hDlg,
|
||||
IDC_LICENSE_EDIT);
|
||||
|
||||
LoadString(hInstance,
|
||||
IDS_LICENSE,
|
||||
strLicense,
|
||||
sizeof(strLicense) / sizeof(TCHAR));
|
||||
|
||||
SetWindowText(hLicenseEditWnd,
|
||||
strLicense);
|
||||
if (AllocAndLoadString(&lpLicense,
|
||||
hInstance,
|
||||
IDS_LICENSE))
|
||||
{
|
||||
SetWindowText(hLicenseEditWnd,
|
||||
lpLicense);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
|
||||
{
|
||||
LocalFree((HLOCAL)lpLicense);
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,
|
||||
LOWORD(wParam));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue