ReactOS 0.4.15-dev-8636-g945e856
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 223 of file CControlPanelFolder.cpp.

224{
228
229 TRACE("(%p)->(flags=0x%08x)\n", this, dwFlags);
230
231 /* enumerate the control panel applets */
232 if (dwFlags & SHCONTF_NONFOLDERS)
233 {
234 LPWSTR p;
235
238 wcscpy(p, L"*.cpl");
239
240 hFile = FindFirstFileW(szPath, &wfd);
241
243 {
244 do
245 {
246 if (!(dwFlags & SHCONTF_INCLUDEHIDDEN) && (wfd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
247 continue;
248
249 if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
250 wcscpy(p, wfd.cFileName);
251 if (wcscmp(wfd.cFileName, L"ncpa.cpl"))
253 }
254 } while(FindNextFileW(hFile, &wfd));
256 }
257
258 RegisterRegistryCPanelApps(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
259 RegisterRegistryCPanelApps(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls");
260 }
261 return TRUE;
262}
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 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 158 of file CControlPanelFolder.cpp.

159{
160 CPlApplet* applet = Control_LoadApplet(0, wpath, NULL);
161 int iconIdx;
162
163 if (applet)
164 {
165 for (UINT i = 0; i < applet->count; ++i)
166 {
167 if (applet->info[i].idIcon > 0)
168 iconIdx = -applet->info[i].idIcon; /* negative icon index instead of icon number */
169 else
170 iconIdx = 0;
171
173 applet->info[i].name,
174 applet->info[i].info,
175 iconIdx);
176
177 if (pidl)
178 AddToEnumList(pidl);
179 }
180 Control_UnloadApplet(applet);
181 }
182 return TRUE;
183}
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 185 of file CControlPanelFolder.cpp.

186{
189 HKEY hkey;
190
191 int cnt = 0;
192
193 if (RegOpenKeyW(hkey_root, szRepPath, &hkey) == ERROR_SUCCESS)
194 {
195 int idx = 0;
196
197 for(; ; idx++)
198 {
199 DWORD nameLen = MAX_PATH;
200 DWORD valueLen = MAX_PATH;
202
203 if (RegEnumValueW(hkey, idx, name, &nameLen, NULL, NULL, (LPBYTE)&value, &valueLen) != ERROR_SUCCESS)
204 break;
205
207 {
209 }
210
212 ++cnt;
213 }
214 RegCloseKey(hkey);
215 }
216
217 return cnt;
218}
#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: