2 * PROJECT: ReactOS System Control Panel Applet
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/cpl/sysdm/licence.c
5 * PURPOSE: Licence dialog box message handler
6 * COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
12 typedef struct _LIC_CONTEXT
15 } LIC_CONTEXT
, *PLIC_CONTEXT
;
19 OnInitDialog(HWND hDlg
, PLIC_CONTEXT pLicInfo
)
25 pLicInfo
->hIcon
= LoadImage(hApplet
,
26 MAKEINTRESOURCE(IDI_CPLSYSTEM
),
35 (LPARAM
)pLicInfo
->hIcon
);
37 /* Load license from resource */
38 if (!(hResInfo
= FindResource(hApplet
,
39 MAKEINTRESOURCE(RC_LICENSE
),
40 MAKEINTRESOURCE(RTDATA
))) ||
41 !(hResMem
= LoadResource(hApplet
, hResInfo
)) ||
42 !(LicenseText
= LockResource(hResMem
)))
44 ShowLastWin32Error(hDlg
);
48 /* Insert the license into the edit control */
53 PostMessage(GetDlgItem(hDlg
, IDC_LICENCEEDIT
),
57 PostMessage(GetDlgItem(hDlg
, IDC_LICENCEEDIT
), WM_VSCROLL
, SB_TOP
, 0);
63 LicenceDlgProc(HWND hDlg
,
68 PLIC_CONTEXT pLicInfo
;
70 UNREFERENCED_PARAMETER(lParam
);
72 pLicInfo
= (PLIC_CONTEXT
)GetWindowLongPtr(hDlg
, DWLP_USER
);
77 pLicInfo
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(LIC_CONTEXT
));
83 SetWindowLongPtr(hDlg
, DWLP_USER
, (LONG_PTR
)pLicInfo
);
84 return OnInitDialog(hDlg
, pLicInfo
);
89 DestroyIcon(pLicInfo
->hIcon
);
90 HeapFree(GetProcessHeap(), 0, pLicInfo
);
95 if ((LOWORD(wParam
) == IDOK
) || (LOWORD(wParam
) == IDCANCEL
))