ReactOS 0.4.15-dev-7934-g1dc8d80
licence.c File Reference
#include "precomp.h"
Include dependency graph for licence.c:

Go to the source code of this file.

Classes

struct  _LIC_CONTEXT
 

Typedefs

typedef struct _LIC_CONTEXT LIC_CONTEXT
 
typedef struct _LIC_CONTEXTPLIC_CONTEXT
 

Functions

static BOOL OnInitDialog (HWND hDlg, PLIC_CONTEXT pLicInfo)
 
INT_PTR CALLBACK LicenceDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Typedef Documentation

◆ LIC_CONTEXT

◆ PLIC_CONTEXT

Function Documentation

◆ LicenceDlgProc()

INT_PTR CALLBACK LicenceDlgProc ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 68 of file licence.c.

72{
73 PLIC_CONTEXT pLicInfo;
74
76
77 pLicInfo = (PLIC_CONTEXT)GetWindowLongPtr(hDlg, DWLP_USER);
78
79 switch (uMsg)
80 {
81 case WM_INITDIALOG:
83 if (pLicInfo == NULL)
84 {
85 EndDialog(hDlg, 0);
86 return FALSE;
87 }
88 SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pLicInfo);
89 return OnInitDialog(hDlg, pLicInfo);
90
91 case WM_DESTROY:
92 if (pLicInfo)
93 {
94 if (pLicInfo->hIconSm)
95 DestroyIcon(pLicInfo->hIconSm);
96
97 if (pLicInfo->hIcon)
98 DestroyIcon(pLicInfo->hIcon);
99
100 HeapFree(GetProcessHeap(), 0, pLicInfo);
101 }
102 break;
103
104 case WM_COMMAND:
105 if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
106 {
107 EndDialog(hDlg,
108 LOWORD(wParam));
109 return TRUE;
110 }
111 break;
112 }
113
114 return FALSE;
115}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static BOOL OnInitDialog(HWND hDlg, PLIC_CONTEXT pLicInfo)
Definition: licence.c:20
struct _LIC_CONTEXT * PLIC_CONTEXT
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
HICON hIconSm
Definition: licence.c:15
HICON hIcon
Definition: licence.c:14
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
#define DWLP_USER
Definition: winuser.h:872
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2053

Referenced by GeneralPageProc().

◆ OnInitDialog()

static BOOL OnInitDialog ( HWND  hDlg,
PLIC_CONTEXT  pLicInfo 
)
static

Definition at line 20 of file licence.c.

21{
22 HRSRC hResInfo;
23 HGLOBAL hResMem;
24 PCSTR LicenseText;
25
26 pLicInfo->hIcon = LoadImage(hApplet,
32 pLicInfo->hIconSm = LoadImage(hApplet,
38
39 SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)pLicInfo->hIcon);
40 SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)pLicInfo->hIconSm);
41
42 /* Load license from resource */
43 if (!(hResInfo = FindResource(hApplet,
46 !(hResMem = LoadResource(hApplet, hResInfo)) ||
47 !(LicenseText = LockResource(hResMem)))
48 {
50 return FALSE;
51 }
52
53 /* Insert the license into the edit control */
54 SetDlgItemTextA(hDlg,
56 LicenseText);
57
60 -1,
61 0);
63 return TRUE;
64}
HINSTANCE hApplet
Definition: access.c:17
#define RTDATA
Definition: resource.h:228
#define IDI_LICENSE
Definition: resource.h:9
#define IDC_LICENCEEDIT
Definition: resource.h:226
#define RC_LICENSE
Definition: resource.h:227
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
const char * PCSTR
Definition: typedefs.h:52
#define FindResource
Definition: winbase.h:3793
LONG_PTR LPARAM
Definition: windef.h:208
#define IMAGE_ICON
Definition: winuser.h:212
#define WM_VSCROLL
Definition: winuser.h:1744
#define SM_CYSMICON
Definition: winuser.h:1013
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1012
#define SM_CYICON
Definition: winuser.h:973
#define SendMessage
Definition: winuser.h:5843
#define EM_SETSEL
Definition: winuser.h:2018
BOOL WINAPI SetDlgItemTextA(_In_ HWND, _In_ int, _In_ LPCSTR)
#define PostMessage
Definition: winuser.h:5832
#define LoadImage
Definition: winuser.h:5815
#define SB_TOP
Definition: winuser.h:578
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define SM_CXICON
Definition: winuser.h:972
#define MAKEINTRESOURCE
Definition: winuser.h:591
int WINAPI GetSystemMetrics(_In_ int)
void ShowLastWin32Error(HWND hwndParent)
Definition: winutils.c:11

Referenced by LicenceDlgProc().