8a142fdf409ef24a987421324931551a9be20da1
[reactos.git] / dll / cpl / openglcfg / openglcfg.c
1 #include "openglcfg.h"
2
3 #include <cpl.h>
4
5 HINSTANCE hApplet = 0;
6
7 LONG CALLBACK AppletInit(HWND hWnd)
8 {
9 PROPSHEETPAGEW psp;
10 PROPSHEETHEADERW psh;
11 WCHAR szCaption[1024];
12
13 LoadStringW(hApplet, IDS_CPLNAME, szCaption, sizeof(szCaption) / sizeof(WCHAR));
14
15 ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
16 psp.dwSize = sizeof(PROPSHEETPAGE);
17 psp.dwFlags = PSP_DEFAULT;
18 psp.hInstance = hApplet;
19 psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGEGENERAL);
20 psp.pfnDlgProc = GeneralPageProc;
21
22 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
23 psh.dwSize = sizeof(PROPSHEETHEADER);
24 psh.dwFlags = PSH_PROPSHEETPAGE;
25 psh.hwndParent = hWnd;
26 psh.hInstance = hApplet;
27 psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLICON));
28 psh.pszCaption = szCaption;
29 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
30 psh.nStartPage = 0;
31 psh.ppsp = &psp;
32
33 return (LONG)(PropertySheet(&psh) != -1);
34 }
35
36 LONG CALLBACK CPlApplet(HWND hWnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
37 {
38 switch (uMsg)
39 {
40 case CPL_INIT:
41 return TRUE;
42
43 case CPL_GETCOUNT:
44 return 1;
45
46 case CPL_INQUIRE:
47 {
48 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
49 CPlInfo->lData = 0;
50 CPlInfo->idIcon = IDI_CPLICON;
51 CPlInfo->idInfo = IDS_CPLDESCRIPTION;
52 CPlInfo->idName = IDS_CPLNAME;
53 }
54 break;
55
56 case CPL_DBLCLK:
57 AppletInit(hWnd);
58 break;
59 }
60
61 return FALSE;
62 }
63
64
65 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
66 {
67 UNREFERENCED_PARAMETER(lpvReserved);
68
69 switch (dwReason)
70 {
71 case DLL_PROCESS_ATTACH:
72 case DLL_THREAD_ATTACH:
73 hApplet = hinstDLL;
74 break;
75 }
76
77 return TRUE;
78 }