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