ReactOS 0.4.15-dev-7958-gcd0bb1a
usrmgr.c File Reference
#include "usrmgr.h"
Include dependency graph for usrmgr.c:

Go to the source code of this file.

Macros

#define NUM_APPLETS   1
 

Functions

static LONG APIENTRY UsrmgrApplet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
LPTSTR GetDlgItemTextAlloc (HWND hwndDlg, INT nDlgItem)
 
LPTSTR GetComboBoxLBTextAlloc (HWND hwndDlg, INT nDlgItem, INT nIndex)
 
static VOID InitPropSheetPage (PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG CALLBACK CPlApplet (HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
 

Variables

HINSTANCE hApplet = 0
 
APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   1

Definition at line 13 of file usrmgr.c.

Function Documentation

◆ CPlApplet()

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

Definition at line 109 of file usrmgr.c.

110{
111 UINT i = (UINT)lParam1;
112
113 switch (uMsg)
114 {
115 case CPL_INIT:
116 return TRUE;
117
118 case CPL_GETCOUNT:
119 return NUM_APPLETS;
120
121 case CPL_INQUIRE:
122 if (i < NUM_APPLETS)
123 {
124 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
125 CPlInfo->lData = 0;
126 CPlInfo->idIcon = Applets[i].idIcon;
127 CPlInfo->idName = Applets[i].idName;
128 CPlInfo->idInfo = Applets[i].idDescription;
129 }
130 else
131 {
132 return TRUE;
133 }
134 break;
135
136 case CPL_DBLCLK:
137 if (i < NUM_APPLETS)
138 Applets[i].AppletProc(hwndCPl, uMsg, lParam1, lParam2);
139 else
140 return TRUE;
141 break;
142 }
143
144 return FALSE;
145}
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
unsigned int UINT
Definition: ndis.h:50
int idDescription
Definition: hotplug.h:37
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
APPLET_PROC AppletProc
Definition: hotplug.h:38
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define NUM_APPLETS
Definition: usrmgr.c:13
APPLET Applets[NUM_APPLETS]
Definition: usrmgr.c:38

◆ DllMain()

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

Definition at line 149 of file usrmgr.c.

150{
152
153 switch (dwReason)
154 {
156 hApplet = hinstDLL;
157 break;
158 }
159
160 return TRUE;
161}
DWORD dwReason
Definition: misc.cpp:154
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static IN DWORD IN LPVOID lpvReserved
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
HINSTANCE hApplet
Definition: usrmgr.c:17

◆ GetComboBoxLBTextAlloc()

LPTSTR GetComboBoxLBTextAlloc ( HWND  hwndDlg,
INT  nDlgItem,
INT  nIndex 
)

Definition at line 28 of file usrmgr.c.

29{
30 INT nLength = (INT)SendDlgItemMessage(hwndDlg, nDlgItem, CB_GETLBTEXTLEN, nIndex, 0);
31 LPTSTR psz = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
32 if (psz)
33 SendDlgItemMessage(hwndDlg, nDlgItem, CB_GETLBTEXT, nIndex, (LPARAM)psz);
34 return psz;
35}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define INT
Definition: polytest.cpp:20
int32_t INT
Definition: typedefs.h:58
_In_ DWORD nLength
Definition: wincon.h:473
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_GETLBTEXTLEN
Definition: winuser.h:1953
#define CB_GETLBTEXT
Definition: winuser.h:1952
#define SendDlgItemMessage
Definition: winuser.h:5842
char TCHAR
Definition: xmlstorage.h:189
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by SetUserProfileData().

◆ GetDlgItemTextAlloc()

LPTSTR GetDlgItemTextAlloc ( HWND  hwndDlg,
INT  nDlgItem 
)

Definition at line 19 of file usrmgr.c.

20{
21 INT nLength = GetWindowTextLength(GetDlgItem(hwndDlg, nDlgItem));
22 LPTSTR psz = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(TCHAR));
23 if (psz)
24 GetDlgItemText(hwndDlg, nDlgItem, psz, nLength + 1);
25 return psz;
26}
#define GetWindowTextLength
Definition: winuser.h:5799
#define GetDlgItemText
Definition: winuser.h:5785
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

Referenced by ChangePasswordDlgProc(), NewGroupDlgProc(), NewUserDlgProc(), SetGeneralGroupData(), SetUserGeneralData(), and SetUserProfileData().

◆ InitPropSheetPage()

static VOID InitPropSheetPage ( PROPSHEETPAGE psp,
WORD  idDlg,
DLGPROC  DlgProc 
)
static

Definition at line 49 of file usrmgr.c.

50{
51 ZeroMemory(psp, sizeof(PROPSHEETPAGE));
52 psp->dwSize = sizeof(PROPSHEETPAGE);
53 psp->dwFlags = PSP_DEFAULT;
54 psp->hInstance = hApplet;
55 psp->pszTemplate = MAKEINTRESOURCE(idDlg);
56 psp->pfnDlgProc = DlgProc;
57}
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
#define PROPSHEETPAGE
Definition: prsht.h:389
#define ZeroMemory
Definition: winbase.h:1712
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by UsrmgrApplet().

◆ PropSheetProc()

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

Definition at line 60 of file usrmgr.c.

61{
62 // NOTE: This callback is needed to set large icon correctly.
64 switch (uMsg)
65 {
67 {
69 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
70 break;
71 }
72 }
73 return 0;
74}
#define IDI_USRMGR_ICON
Definition: resource.h:4
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by UsrmgrApplet().

◆ UsrmgrApplet()

static LONG APIENTRY UsrmgrApplet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 78 of file usrmgr.c.

79{
80 PROPSHEETPAGE psp[2];
82
86
87 ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
88 psh.dwSize = sizeof(PROPSHEETHEADER);
90 psh.hwndParent = hwnd;
91 psh.hInstance = hApplet;
92 psh.pszIcon = MAKEINTRESOURCEW(IDI_USRMGR_ICON);
93 psh.pszCaption = MAKEINTRESOURCEW(IDS_CPLNAME);
94 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
95 psh.nStartPage = 0;
96 psh.ppsp = psp;
97 psh.pfnCallback = PropSheetProc;
98
101 /* InitPropSheetPage(&psp[2], IDD_EXTRA, ExtraPageProc); */
102
103 return (LONG)(PropertySheet(&psh) != -1);
104}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define IDS_CPLNAME
Definition: resource.h:8
#define IDD_USERS
Definition: resource.h:10
#define IDD_GROUPS
Definition: resource.h:11
INT_PTR CALLBACK GroupsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: groups.c:425
long LONG
Definition: pedump.c:60
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PropertySheet
Definition: prsht.h:400
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
INT_PTR CALLBACK UsersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: users.c:655
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: usrmgr.c:60
static VOID InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
Definition: usrmgr.c:49
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
Initial value:
=
{
{
}
}
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
static LONG APIENTRY UsrmgrApplet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: usrmgr.c:78

Definition at line 38 of file usrmgr.c.

Referenced by CPlApplet().

◆ hApplet

HINSTANCE hApplet = 0

Definition at line 17 of file usrmgr.c.

Referenced by DllMain(), InitPropSheetPage(), PropSheetProc(), and UsrmgrApplet().