ReactOS 0.4.15-dev-7953-g1f49173
CControlPanelEnum Class Reference
Inheritance diagram for CControlPanelEnum:
Collaboration diagram for CControlPanelEnum:

Public Member Functions

 CControlPanelEnum ()
 
 ~CControlPanelEnum ()
 
HRESULT WINAPI Initialize (DWORD dwFlags, IEnumIDList *pRegEnumerator)
 
BOOL RegisterCPanelApp (LPCWSTR path)
 
int RegisterRegistryCPanelApps (HKEY hkey_root, LPCWSTR szRepPath)
 
BOOL CreateCPanelEnumList (DWORD dwFlags)
 
- Public Member Functions inherited from CEnumIDListBase
 CEnumIDListBase ()
 
virtual ~CEnumIDListBase ()
 
BOOL AddToEnumList (LPITEMIDLIST pidl)
 
BOOL DeleteList ()
 
BOOL HasItemWithCLSID (LPITEMIDLIST pidl)
 
HRESULT AppendItemsFromEnumerator (IEnumIDList *pEnum)
 
STDMETHOD() Next (ULONG celt, LPITEMIDLIST *rgelt, ULONG *pceltFetched) override
 
STDMETHOD() Skip (ULONG celt) override
 
STDMETHOD() Reset () override
 
STDMETHOD() Clone (IEnumIDList **ppenum) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from IEnumIDList
HRESULT Next ([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt, [out] ULONG *pceltFetched)
 
HRESULT Skip ([in] ULONG celt)
 
HRESULT Reset ()
 
HRESULT Clone ([out] IEnumIDList **ppenum)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Additional Inherited Members

- Public Types inherited from IEnumIDList
typedef IEnumIDListLPENUMIDLIST
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 30 of file CControlPanelFolder.cpp.

Constructor & Destructor Documentation

◆ CControlPanelEnum()

CControlPanelEnum::CControlPanelEnum ( )

Definition at line 62 of file CControlPanelFolder.cpp.

63{
64}

◆ ~CControlPanelEnum()

CControlPanelEnum::~CControlPanelEnum ( )

Definition at line 66 of file CControlPanelFolder.cpp.

67{
68}

Member Function Documentation

◆ CreateCPanelEnumList()

BOOL CControlPanelEnum::CreateCPanelEnumList ( DWORD  dwFlags)

Definition at line 214 of file CControlPanelFolder.cpp.

215{
219
220 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
221
222 /* enumerate the control panel applets */
223 if (dwFlags & SHCONTF_NONFOLDERS)
224 {
225 LPWSTR p;
226
229 wcscpy(p, L"*.cpl");
230
231 hFile = FindFirstFileW(szPath, &wfd);
232
234 {
235 do
236 {
237 if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
238 continue;
239
240 if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
241 wcscpy(p, wfd.cFileName);
242 if (wcscmp(wfd.cFileName, L"ncpa.cpl"))
244 }
245 } while(FindNextFileW(hFile, &wfd));
247 }
248
249 RegisterRegistryCPanelApps(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
250 RegisterRegistryCPanelApps(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
251 }
252 return TRUE;
253}
BOOL RegisterCPanelApp(LPCWSTR path)
int RegisterRegistryCPanelApps(HKEY hkey_root, LPCWSTR szRepPath)
#define TRUE
Definition: types.h:120
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
GLfloat GLfloat p
Definition: glext.h:8902
LPCWSTR szPath
Definition: env.c:37
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define L(x)
Definition: ntvdm.h:50
#define PathAddBackslashW
Definition: pathcch.h:301
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define TRACE(s)
Definition: solgame.cpp:4
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_USER
Definition: winreg.h:11
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by Initialize().

◆ Initialize()

HRESULT WINAPI CControlPanelEnum::Initialize ( DWORD  dwFlags,
IEnumIDList pRegEnumerator 
)

Definition at line 70 of file CControlPanelFolder.cpp.

71{
73 return E_FAIL;
74 AppendItemsFromEnumerator(pRegEnumerator);
75 return S_OK;
76}
BOOL CreateCPanelEnumList(DWORD dwFlags)
HRESULT AppendItemsFromEnumerator(IEnumIDList *pEnum)
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
#define S_OK
Definition: intsafe.h:52

◆ RegisterCPanelApp()

BOOL CControlPanelEnum::RegisterCPanelApp ( LPCWSTR  path)

Definition at line 149 of file CControlPanelFolder.cpp.

150{
151 CPlApplet* applet = Control_LoadApplet(0, wpath, NULL);
152 int iconIdx;
153
154 if (applet)
155 {
156 for (UINT i = 0; i < applet->count; ++i)
157 {
158 if (applet->info[i].idIcon > 0)
159 iconIdx = -applet->info[i].idIcon; /* negative icon index instead of icon number */
160 else
161 iconIdx = 0;
162
164 applet->info[i].name,
165 applet->info[i].info,
166 iconIdx);
167
168 if (pidl)
169 AddToEnumList(pidl);
170 }
171 Control_UnloadApplet(applet);
172 }
173 return TRUE;
174}
static LPITEMIDLIST _ILCreateCPanelApplet(LPCWSTR pszName, LPCWSTR pszDisplayName, LPCWSTR pszComment, int iIconIdx)
BOOL AddToEnumList(LPITEMIDLIST pidl)
#define NULL
Definition: types.h:112
CPlApplet * Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel *panel)
Definition: control.c:61
void Control_UnloadApplet(CPlApplet *applet)
Definition: control.c:45
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
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
struct applet_info info[1]
Definition: cpanel.h:52
unsigned count
Definition: cpanel.h:49

Referenced by CreateCPanelEnumList(), and RegisterRegistryCPanelApps().

◆ RegisterRegistryCPanelApps()

int CControlPanelEnum::RegisterRegistryCPanelApps ( HKEY  hkey_root,
LPCWSTR  szRepPath 
)

Definition at line 176 of file CControlPanelFolder.cpp.

177{
180 HKEY hkey;
181
182 int cnt = 0;
183
184 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
185 {
186 int idx = 0;
187
188 for(; ; idx++)
189 {
190 DWORD nameLen = MAX_PATH;
191 DWORD valueLen = MAX_PATH;
193
194 if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS)
195 break;
196
198 {
200 }
201
203 ++cnt;
204 }
205 RegCloseKey(hkey);
206 }
207
208 return cnt;
209}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned int idx
Definition: utils.c:41
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2830
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint buffer
Definition: glext.h:5915
Definition: name.c:39
unsigned char * LPBYTE
Definition: typedefs.h:53
Definition: pdh_main.c:94

Referenced by CreateCPanelEnumList().


The documentation for this class was generated from the following file: