ReactOS  0.4.15-dev-3165-gdf6fff7
openglcfg.c File Reference
#include "openglcfg.h"
#include <cpl.h>
Include dependency graph for openglcfg.c:

Go to the source code of this file.

Functions

static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG CALLBACK AppletInit (HWND hWnd)
 
LONG CALLBACK CPlApplet (HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = 0
 

Function Documentation

◆ AppletInit()

LONG CALLBACK AppletInit ( HWND  hWnd)

Definition at line 24 of file openglcfg.c.

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 }
HWND hwndParent
Definition: prsht.h:295
#define MAKEINTRESOURCE
Definition: winuser.h:591
LPCPROPSHEETPAGEW ppsp
Definition: prsht.h:308
LPCWSTR pszTemplate
Definition: prsht.h:218
HWND hWnd
Definition: settings.c:17
#define ZeroMemory
Definition: winbase.h:1664
#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)
#define IDS_CPLNAME
Definition: resource.h:8
DWORD dwSize
Definition: prsht.h:214
#define PSH_USEICONID
Definition: prsht.h:42
INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
LPCWSTR pszCaption
Definition: prsht.h:301
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
#define PSP_DEFAULT
Definition: prsht.h:22
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hInstance
Definition: prsht.h:296
LPCWSTR pszIcon
Definition: prsht.h:299
#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 IDD_PROPPAGEGENERAL
Definition: resource.h:10
HINSTANCE hInstance
Definition: prsht.h:216
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PropertySheet
Definition: prsht.h:400
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
DWORD dwFlags
Definition: prsht.h:215
#define PROPSHEETPAGE
Definition: prsht.h:389
UINT nStartPage
Definition: prsht.h:304

Referenced by CPlApplet().

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hWnd,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 54 of file openglcfg.c.

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 }
Definition: cpl.h:24
#define TRUE
Definition: types.h:120
LONG CALLBACK AppletInit(HWND hWnd)
Definition: openglcfg.c:24
HWND hWnd
Definition: settings.c:17
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define CPL_DBLCLK
Definition: cpl.h:16
#define IDS_CPLNAME
Definition: resource.h:8
#define FALSE
Definition: types.h:117
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
#define IDI_CPLICON
Definition: resource.h:4
#define CPL_INIT
Definition: cpl.h:12
#define CPL_INQUIRE
Definition: cpl.h:14
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
#define CPL_GETCOUNT
Definition: cpl.h:13

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpvReserved 
)

Definition at line 83 of file openglcfg.c.

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 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static IN DWORD IN LPVOID lpvReserved
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hApplet
Definition: openglcfg.c:5

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 8 of file openglcfg.c.

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 }
static HICON
Definition: imagelist.c:84
HINSTANCE hApplet
Definition: openglcfg.c:5
LONG_PTR LPARAM
Definition: windef.h:208
#define IDI_CPLICON
Definition: resource.h:4
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by AppletInit().

Variable Documentation

◆ hApplet

HINSTANCE hApplet = 0

Definition at line 5 of file openglcfg.c.

Referenced by AppletInit(), DllMain(), and PropSheetProc().