ReactOS  0.4.15-dev-1377-ga59cecd
openglcfg.c
Go to the documentation of this file.
1 #include "openglcfg.h"
2 
3 #include <cpl.h>
4 
6 
7 static int CALLBACK
9 {
10  // NOTE: This callback is needed to set large icon correctly.
11  HICON hIcon;
12  switch (uMsg)
13  {
14  case PSCB_INITIALIZED:
15  {
17  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
18  break;
19  }
20  }
21  return 0;
22 }
23 
25 {
26  PROPSHEETPAGEW psp;
27  PROPSHEETHEADERW psh;
28  WCHAR szCaption[1024];
29 
30  LoadStringW(hApplet, IDS_CPLNAME, szCaption, sizeof(szCaption) / sizeof(WCHAR));
31 
32  ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
33  psp.dwSize = sizeof(PROPSHEETPAGE);
34  psp.dwFlags = PSP_DEFAULT;
35  psp.hInstance = hApplet;
38 
39  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
40  psh.dwSize = sizeof(PROPSHEETHEADER);
42  psh.hwndParent = hWnd;
43  psh.hInstance = hApplet;
45  psh.pszCaption = szCaption;
46  psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
47  psh.nStartPage = 0;
48  psh.ppsp = &psp;
50 
51  return (LONG)(PropertySheet(&psh) != -1);
52 }
53 
54 LONG CALLBACK CPlApplet(HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
55 {
56  switch (uMsg)
57  {
58  case CPL_INIT:
59  return TRUE;
60 
61  case CPL_GETCOUNT:
62  return 1;
63 
64  case CPL_INQUIRE:
65  {
66  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
67  CPlInfo->lData = 0;
68  CPlInfo->idIcon = IDI_CPLICON;
69  CPlInfo->idInfo = IDS_CPLDESCRIPTION;
70  CPlInfo->idName = IDS_CPLNAME;
71  }
72  break;
73 
74  case CPL_DBLCLK:
76  break;
77  }
78 
79  return FALSE;
80 }
81 
82 
84 {
86 
87  switch (dwReason)
88  {
89  case DLL_PROCESS_ATTACH:
90  case DLL_THREAD_ATTACH:
91  hApplet = hinstDLL;
92  break;
93  }
94 
95  return TRUE;
96 }
HWND hwndParent
Definition: prsht.h:295
#define MAKEINTRESOURCE
Definition: winuser.h:591
static HICON
Definition: imagelist.c:84
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
Definition: cpl.h:24
LPCWSTR pszTemplate
Definition: prsht.h:218
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define DLL_THREAD_ATTACH
Definition: compat.h:132
LONG CALLBACK AppletInit(HWND hWnd)
Definition: openglcfg.c:24
#define CALLBACK
Definition: compat.h:35
HWND hWnd
Definition: settings.c:17
int idInfo
Definition: cpl.h:27
#define ZeroMemory
Definition: winbase.h:1648
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define PSH_USECALLBACK
Definition: prsht.h:48
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static IN DWORD IN LPVOID lpvReserved
int idIcon
Definition: cpl.h:25
#define CPL_DBLCLK
Definition: cpl.h:16
DWORD dwReason
Definition: misc.cpp:154
#define IDS_CPLNAME
Definition: resource.h:8
DWORD dwSize
Definition: prsht.h:214
#define PSH_USEICONID
Definition: prsht.h:42
#define FALSE
Definition: types.h:117
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPCWSTR pszCaption
Definition: prsht.h:301
unsigned int BOOL
Definition: ntddk_ex.h:94
DLGPROC pfnDlgProc
Definition: prsht.h:226
long LONG
Definition: pedump.c:60
HINSTANCE hApplet
Definition: openglcfg.c:5
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
#define PROPSHEETHEADER
Definition: prsht.h:392
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
LONG CALLBACK CPlApplet(HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: openglcfg.c:54
#define PSP_DEFAULT
Definition: prsht.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hInstance
Definition: prsht.h:296
#define WINAPI
Definition: msvc.h:6
LPCWSTR pszIcon
Definition: prsht.h:299
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDI_CPLICON
Definition: resource.h:4
DWORD dwSize
Definition: prsht.h:293
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: openglcfg.c:8
DWORD dwFlags
Definition: prsht.h:294
#define CPL_INIT
Definition: cpl.h:12
#define IDD_PROPPAGEGENERAL
Definition: resource.h:10
#define CPL_INQUIRE
Definition: cpl.h:14
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
Definition: openglcfg.c:83
HINSTANCE hInstance
Definition: prsht.h:216
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define PropertySheet
Definition: prsht.h:400
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
LPARAM lParam
Definition: combotst.c:139
DWORD dwFlags
Definition: prsht.h:215
#define CPL_GETCOUNT
Definition: cpl.h:13
#define PROPSHEETPAGE
Definition: prsht.h:389
#define ICON_BIG
Definition: tnclass.cpp:51
UINT nStartPage
Definition: prsht.h:304