ReactOS  0.4.14-dev-831-gef8c9239
usrmgr.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS User Manager Control Panel
4  * FILE: dll/cpl/usrmgr/usrmgr.c
5  * PURPOSE: Main functions
6  *
7  * PROGRAMMERS: Eric Kohl
8  */
9 
10 #include "usrmgr.h"
11 
12 #define NUM_APPLETS 1
13 
15 
17 
18 /* Applets */
20 {
21  {
26  }
27 };
28 
29 
30 static VOID
32 {
33  ZeroMemory(psp, sizeof(PROPSHEETPAGE));
34  psp->dwSize = sizeof(PROPSHEETPAGE);
35  psp->dwFlags = PSP_DEFAULT;
36  psp->hInstance = hApplet;
37  psp->pszTemplate = MAKEINTRESOURCE(idDlg);
38  psp->pfnDlgProc = DlgProc;
39 }
40 
41 static int CALLBACK
43 {
44  // NOTE: This callback is needed to set large icon correctly.
45  HICON hIcon;
46  switch (uMsg)
47  {
48  case PSCB_INITIALIZED:
49  {
51  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
52  break;
53  }
54  }
55  return 0;
56 }
57 
58 /* Display Applet */
59 static LONG APIENTRY
61 {
62  PROPSHEETPAGE psp[2];
63  PROPSHEETHEADER psh;
64  TCHAR Caption[1024];
65 
69 
70  LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
71 
72  ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
73  psh.dwSize = sizeof(PROPSHEETHEADER);
75  psh.hwndParent = hwnd;
76  psh.hInstance = hApplet;
77  psh.pszIcon = MAKEINTRESOURCEW(IDI_USRMGR_ICON);
78  psh.pszCaption = Caption;
79  psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
80  psh.nStartPage = 0;
81  psh.ppsp = psp;
82  psh.pfnCallback = PropSheetProc;
83 
86  /* InitPropSheetPage(&psp[2], IDD_EXTRA, ExtraPageProc); */
87 
88  return (LONG)(PropertySheet(&psh) != -1);
89 }
90 
91 
92 /* Control Panel Callback */
94 CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
95 {
96  int i = (int)lParam1;
97 
98  switch (uMsg)
99  {
100  case CPL_INIT:
101  return TRUE;
102 
103  case CPL_GETCOUNT:
104  return NUM_APPLETS;
105 
106  case CPL_INQUIRE:
107  {
108  CPLINFO *CPlInfo = (CPLINFO*)lParam2;
109  CPlInfo->lData = 0;
110  CPlInfo->idIcon = Applets[i].idIcon;
111  CPlInfo->idName = Applets[i].idName;
112  CPlInfo->idInfo = Applets[i].idDescription;
113  }
114  break;
115 
116  case CPL_DBLCLK:
117  Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
118  break;
119  }
120 
121  return FALSE;
122 }
123 
124 
125 BOOL WINAPI
127 {
129 
130  switch (dwReason)
131  {
132  case DLL_PROCESS_ATTACH:
133  hApplet = hinstDLL;
134  break;
135  }
136 
137  return TRUE;
138 }
HINSTANCE hApplet
Definition: usrmgr.c:16
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD idDlg
Definition: desk.c:109
#define MAKEINTRESOURCE
Definition: winuser.h:591
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
Definition: cpl.h:24
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
int idName
Definition: hotplug.h:27
int idIcon
Definition: hotplug.h:26
#define CALLBACK
Definition: compat.h:27
int idInfo
Definition: cpl.h:27
#define IDD_USERS
Definition: resource.h:10
#define ZeroMemory
Definition: winbase.h:1642
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:689
#define PSH_USECALLBACK
Definition: prsht.h:48
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
Definition: usrmgr.c:126
#define IDI_USRMGR_ICON
Definition: resource.h:4
WPARAM wParam
Definition: combotst.c:138
static IN DWORD IN LPVOID lpvReserved
int idIcon
Definition: cpl.h:25
int idDescription
Definition: hotplug.h:28
#define CPL_DBLCLK
Definition: cpl.h:16
DWORD dwReason
Definition: misc.cpp:154
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: usrmgr.c:42
#define IDS_CPLNAME
Definition: resource.h:8
#define PSH_USEICONID
Definition: prsht.h:42
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: groups.c:436
#define PROPSHEETHEADER
Definition: prsht.h:374
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
char TCHAR
Definition: xmlstorage.h:189
#define PSP_DEFAULT
Definition: prsht.h:22
#define NUM_APPLETS
Definition: usrmgr.c:12
APPLET_PROC AppletProc
Definition: hotplug.h:29
#define WINAPI
Definition: msvc.h:6
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#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
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
Definition: usrmgr.c:94
#define IDD_GROUPS
Definition: resource.h:11
#define PSCB_INITIALIZED
Definition: prsht.h:75
APPLET Applets[NUM_APPLETS]
Definition: usrmgr.c:19
static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: usrmgr.c:60
HICON hIcon
Definition: msconfig.c:44
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
Definition: usrmgr.c:31
unsigned int UINT
Definition: ndis.h:50
#define PropertySheet
Definition: prsht.h:382
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
DLGPROC DlgProc
Definition: desk.c:110
#define CPL_GETCOUNT
Definition: cpl.h:13
#define LoadString
Definition: winuser.h:5794
#define PROPSHEETPAGE
Definition: prsht.h:371
#define APIENTRY
Definition: api.h:79
#define ICON_BIG
Definition: tnclass.cpp:51
Definition: hotplug.h:24
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31