ReactOS  0.4.15-dev-1197-g8081ba9
main.c File Reference
#include "main.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define NUM_APPLETS   (2)
 

Functions

BOOL InitPropSheetPage (PROPSHEETHEADER *ppsh, WORD idDlg, DLGPROC DlgProc)
 
BOOL CALLBACK PropSheetAddPage (HPROPSHEETPAGE hpage, LPARAM lParam)
 
LONG CALLBACK CPlApplet (HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
 

Variables

HINSTANCE hApplet = 0
 
APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   (2)

Definition at line 30 of file main.c.

Function Documentation

◆ CPlApplet()

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

Definition at line 85 of file main.c.

89 {
90  switch(uMsg)
91  {
92  case CPL_INIT:
93  return TRUE;
94 
95  case CPL_GETCOUNT:
96  return NUM_APPLETS;
97 
98  case CPL_INQUIRE:
99  {
100  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
101  UINT uAppIndex = (UINT)lParam1;
102 
103  CPlInfo->lData = lParam1;
104  CPlInfo->idIcon = Applets[uAppIndex].idIcon;
105  CPlInfo->idName = Applets[uAppIndex].idName;
106  CPlInfo->idInfo = Applets[uAppIndex].idDescription;
107  break;
108  }
109 
110  case CPL_DBLCLK:
111  {
112  UINT uAppIndex = (UINT)lParam1;
113  Applets[uAppIndex].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
114  break;
115  }
116 
117  case CPL_STARTWPARMSW:
118  return Applets[(UINT)lParam1].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
119  }
120 
121  return FALSE;
122 }
Definition: cpl.h:24
#define TRUE
Definition: types.h:120
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
int idDescription
Definition: hotplug.h:37
#define CPL_DBLCLK
Definition: cpl.h:16
#define FALSE
Definition: types.h:117
APPLET Applets[NUM_APPLETS]
Definition: main.c:37
APPLET_PROC AppletProc
Definition: hotplug.h:38
#define CPL_STARTWPARMSW
Definition: cpl.h:21
#define CPL_INIT
Definition: cpl.h:12
#define NUM_APPLETS
Definition: main.c:30
#define CPL_INQUIRE
Definition: cpl.h:14
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
unsigned int UINT
Definition: ndis.h:50
#define CPL_GETCOUNT
Definition: cpl.h:13

◆ DllMain()

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

Definition at line 126 of file main.c.

129 {
131  UNREFERENCED_PARAMETER(lpReserved);
132 
133  switch(dwReason)
134  {
135  case DLL_PROCESS_ATTACH:
136  InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
139 
140  hApplet = hinstDLL;
141  break;
142  }
143 
144  return TRUE;
145 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
HINSTANCE hApplet
Definition: main.c:33
DWORD dwReason
Definition: misc.cpp:154
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62
#define ICC_BAR_CLASSES
Definition: commctrl.h:60
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58

◆ InitPropSheetPage()

BOOL InitPropSheetPage ( PROPSHEETHEADER ppsh,
WORD  idDlg,
DLGPROC  DlgProc 
)

Definition at line 45 of file main.c.

46 {
47  HPROPSHEETPAGE hPage;
48  PROPSHEETPAGE psp;
49 
50  if (ppsh->nPages < MAX_CPL_PAGES)
51  {
52  ZeroMemory(&psp, sizeof(psp));
53  psp.dwSize = sizeof(psp);
54  psp.dwFlags = PSP_DEFAULT;
55  psp.hInstance = hApplet;
56  psp.pszTemplate = MAKEINTRESOURCE(idDlg);
57  psp.pfnDlgProc = DlgProc;
58 
59  hPage = CreatePropertySheetPage(&psp);
60  if (hPage != NULL)
61  {
62  return PropSheetAddPage(hPage, (LPARAM)ppsh);
63  }
64  }
65 
66  return FALSE;
67 }
WORD idDlg
Definition: desk.c:110
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ZeroMemory
Definition: winbase.h:1648
#define MAX_CPL_PAGES
Definition: main.h:47
HINSTANCE hApplet
Definition: main.c:33
#define FALSE
Definition: types.h:117
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSP_DEFAULT
Definition: prsht.h:22
BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam)
Definition: main.c:70
BOOL CALLBACK DlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: main.c:93
#define PROPSHEETPAGE
Definition: prsht.h:389

◆ PropSheetAddPage()

BOOL CALLBACK PropSheetAddPage ( HPROPSHEETPAGE  hpage,
LPARAM  lParam 
)

Definition at line 70 of file main.c.

71 {
73  if (ppsh != NULL && ppsh->nPages < MAX_CPL_PAGES)
74  {
75  ppsh->phpage[ppsh->nPages++] = hpage;
76  return TRUE;
77  }
78 
79  return FALSE;
80 }
#define TRUE
Definition: types.h:120
#define MAX_CPL_PAGES
Definition: main.h:47
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
#define PROPSHEETHEADER
Definition: prsht.h:392
LPARAM lParam
Definition: combotst.c:139

Referenced by InitPropSheetPage().

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
Initial value:
=
{
}
LONG APIENTRY MouseApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: mouse.c:1829
#define IDS_CPLDESCRIPTION_1
Definition: resource.h:8
#define IDS_CPLNAME_2
Definition: resource.h:36
#define IDS_CPLNAME_1
Definition: resource.h:6
LONG APIENTRY KeyboardApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: keyboard.c:303
#define IDC_CPLICON_2
Definition: resource.h:6
#define IDS_CPLDESCRIPTION_2
Definition: resource.h:37
#define IDC_CPLICON_1
Definition: resource.h:4

Definition at line 37 of file main.c.

Referenced by CPlApplet().

◆ hApplet

HINSTANCE hApplet = 0

Definition at line 33 of file main.c.

Referenced by DllMain(), and InitPropSheetPage().