ReactOS 0.4.16-dev-1098-g0ca6002
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)
 
template<class T >
BOOL HasItemWithCLSIDImpl (LPCITEMIDLIST pidl)
 
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
 
- Protected Attributes inherited from CEnumIDListBase
ENUMLISTmpFirst
 
ENUMLISTmpLast
 
ENUMLISTmpCurrent
 

Detailed Description

Definition at line 39 of file CControlPanelFolder.cpp.

Constructor & Destructor Documentation

◆ CControlPanelEnum()

CControlPanelEnum::CControlPanelEnum ( )

Definition at line 71 of file CControlPanelFolder.cpp.

72{
73}

◆ ~CControlPanelEnum()

CControlPanelEnum::~CControlPanelEnum ( )

Definition at line 75 of file CControlPanelFolder.cpp.

76{
77}

Member Function Documentation

◆ CreateCPanelEnumList()

BOOL CControlPanelEnum::CreateCPanelEnumList ( DWORD  dwFlags)

Definition at line 231 of file CControlPanelFolder.cpp.

232{
236
237 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
238
239 /* enumerate the control panel applets */
240 if (dwFlags & SHCONTF_NONFOLDERS)
241 {
242 LPWSTR p;
243
246 wcscpy(p, L"*.cpl");
247
248 hFile = FindFirstFileW(szPath, &wfd);
249
251 {
252 do
253 {
254 if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
255 continue;
256
257 if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
258 wcscpy(p, wfd.cFileName);
259 if (wcscmp(wfd.cFileName, L"ncpa.cpl"))
261 }
262 } while(FindNextFileW(hFile, &wfd));
264 }
265
266 RegisterRegistryCPanelApps(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
267 RegisterRegistryCPanelApps(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
268 }
269 return TRUE;
270}
BOOL RegisterCPanelApp(LPCWSTR path)
int RegisterRegistryCPanelApps(HKEY hkey_root, LPCWSTR szRepPath)
wcscpy
#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
_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 79 of file CControlPanelFolder.cpp.

80{
82 return E_FAIL;
83 AppendItemsFromEnumerator(pRegEnumerator);
84 return S_OK;
85}
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 166 of file CControlPanelFolder.cpp.

167{
168 CPlApplet* applet = Control_LoadApplet(0, wpath, NULL);
169 int iconIdx;
170
171 if (applet)
172 {
173 for (UINT i = 0; i < applet->count; ++i)
174 {
175 if (applet->info[i].idIcon > 0)
176 iconIdx = -applet->info[i].idIcon; /* negative icon index instead of icon number */
177 else
178 iconIdx = 0;
179
181 applet->info[i].name,
182 applet->info[i].info,
183 iconIdx);
184
185 if (pidl)
186 AddToEnumList(pidl);
187 }
188 Control_UnloadApplet(applet);
189 }
190 return TRUE;
191}
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 193 of file CControlPanelFolder.cpp.

194{
197 HKEY hkey;
198
199 int cnt = 0;
200
201 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
202 {
203 int idx = 0;
204
205 for(; ; idx++)
206 {
207 DWORD nameLen = MAX_PATH;
208 DWORD valueLen = MAX_PATH;
210
211 if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS)
212 break;
213
215 {
217 }
218
220 ++cnt;
221 }
222 RegCloseKey(hkey);
223 }
224
225 return cnt;
226}
#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:96
_In_ size_t cnt
Definition: wcstombs.cpp:43

Referenced by CreateCPanelEnumList().


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