ReactOS 0.4.15-dev-5836-g942b022
CControlPanelFolder.cpp File Reference
#include <precomp.h>
Include dependency graph for CControlPanelFolder.cpp:

Go to the source code of this file.

Classes

class  CControlPanelEnum
 

Enumerations

enum  controlpanel_columns { CONTROLPANEL_COL_NAME , CONTROLPANEL_COL_COMMENT , CONTROLPANEL_COL_COUNT }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static LPITEMIDLIST _ILCreateCPanelApplet (LPCWSTR pszName, LPCWSTR pszDisplayName, LPCWSTR pszComment, int iIconIdx)
 
static PIDLCPanelStruct_ILGetCPanelPointer (LPCITEMIDLIST pidl)
 
HRESULT CCPLExtractIcon_CreateInstance (IShellFolder *psf, LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppvOut)
 
EXTERN_C void WINAPI Control_RunDLLW (HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 

Variables

static const shvheader ControlPanelSFHeader []
 

Enumeration Type Documentation

◆ controlpanel_columns

Enumerator
CONTROLPANEL_COL_NAME 
CONTROLPANEL_COL_COMMENT 
CONTROLPANEL_COL_COUNT 

Definition at line 55 of file CControlPanelFolder.cpp.

Function Documentation

◆ _ILCreateCPanelApplet()

static LPITEMIDLIST _ILCreateCPanelApplet ( LPCWSTR  pszName,
LPCWSTR  pszDisplayName,
LPCWSTR  pszComment,
int  iIconIdx 
)
static

Definition at line 78 of file CControlPanelFolder.cpp.

79{
81 LPITEMIDLIST pidl;
83 int cchName, cchDisplayName, cchComment, cbData;
84
85 /* Calculate lengths of given strings */
86 cchName = wcslen(pszName);
87 cchDisplayName = wcslen(pszDisplayName);
88 cchComment = wcslen(pszComment);
89
90 /* Allocate PIDL */
91 cbData = sizeof(pidl->mkid.cb) + sizeof(pData->type) + sizeof(pData->u.cpanel) - sizeof(pData->u.cpanel.szName)
92 + (cchName + cchDisplayName + cchComment + 3) * sizeof(WCHAR);
93 pidl = (LPITEMIDLIST)SHAlloc(cbData + sizeof(WORD));
94 if (!pidl)
95 return NULL;
96
97 /* Copy data to allocated memory */
98 pidl->mkid.cb = cbData;
99 pData = (PIDLDATA *)pidl->mkid.abID;
100 pData->type = PT_CPLAPPLET;
101
102 pCP = &pData->u.cpanel;
103 pCP->dummy = 0;
104 pCP->iconIdx = iIconIdx;
105 wcscpy(pCP->szName, pszName);
106 pCP->offsDispName = cchName + 1;
107 wcscpy(pCP->szName + pCP->offsDispName, pszDisplayName);
108 pCP->offsComment = pCP->offsDispName + cchDisplayName + 1;
109 wcscpy(pCP->szName + pCP->offsComment, pszComment);
110
111 /* Add PIDL NULL terminator */
112 *(WORD*)(pCP->szName + pCP->offsComment + cchComment + 1) = 0;
113
114 pcheck(pidl);
115
116 return pidl;
117}
BOOL pcheck(LPCITEMIDLIST pidl)
Definition: debughlp.cpp:349
#define NULL
Definition: types.h:112
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:304
unsigned short WORD
Definition: ntddk_ex.h:93
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PT_CPLAPPLET
Definition: pidl.h:86
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
WORD offsComment
Definition: pidl.h:115
WCHAR szName[1]
Definition: pidl.h:116
WORD offsDispName
Definition: pidl.h:114
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
_In_ LPCSTR _Out_writes_to_opt_ cchDisplayName LPSTR _Inout_ LPDWORD cchDisplayName
Definition: winbase.h:2778
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2754
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CControlPanelEnum::RegisterCPanelApp().

◆ _ILGetCPanelPointer()

static PIDLCPanelStruct * _ILGetCPanelPointer ( LPCITEMIDLIST  pidl)
static

Definition at line 123 of file CControlPanelFolder.cpp.

124{
126
127 if (pdata && pdata->type == PT_CPLAPPLET)
128 return (PIDLCPanelStruct *) & (pdata->u.cpanel);
129
130 return NULL;
131}
static PROTOCOLDATA * pdata
Definition: protocol.c:158
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
Definition: pidl.c:2187

Referenced by CCPLExtractIcon_CreateInstance(), CControlPanelFolder::CompareIDs(), CControlPanelFolder::GetDetailsOf(), CControlPanelFolder::GetDisplayNameOf(), CControlPanelFolder::GetUIObjectOf(), and CCPLItemMenu::InvokeCommand().

◆ CCPLExtractIcon_CreateInstance()

HRESULT CCPLExtractIcon_CreateInstance ( IShellFolder psf,
LPCITEMIDLIST  pidl,
REFIID  riid,
LPVOID ppvOut 
)

Definition at line 133 of file CControlPanelFolder.cpp.

134{
136 if (!pData)
137 return E_FAIL;
138
139 CComPtr<IDefaultExtractIconInit> initIcon;
142 return hr;
143
144 initIcon->SetNormalIcon(pData->szName, (int)pData->iconIdx != -1 ? pData->iconIdx : 0);
145
146 return initIcon->QueryInterface(riid, ppvOut);
147}
static PIDLCPanelStruct * _ILGetCPanelPointer(LPCITEMIDLIST pidl)
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
#define E_FAIL
Definition: ddrawi.h:102
REFIID riid
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

Referenced by CControlPanelFolder::GetUIObjectOf().

◆ Control_RunDLLW()

EXTERN_C void WINAPI Control_RunDLLW ( HWND  hWnd,
HINSTANCE  hInst,
LPCWSTR  cmd,
DWORD  nCmdShow 
)

Definition at line 1050 of file control.c.

1051{
1052 CPanel panel;
1053
1054 TRACE("(%p, %p, %s, 0x%08x)\n",
1055 hWnd, hInst, debugstr_w(cmd), nCmdShow);
1056
1057#ifndef __REACTOS__
1058 memset(&panel, 0, sizeof(panel));
1059 list_init( &panel.applets );
1060#endif
1061
1062 if (!cmd || !*cmd) {
1063 Control_DoWindow(&panel, hWnd, hInst);
1064 } else {
1065 Control_DoLaunch(&panel, hWnd, cmd);
1066 }
1067}
HWND hWnd
Definition: settings.c:17
static void list_init(struct list_entry *head)
Definition: list.h:51
static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst)
Definition: control.c:701
static void Control_DoLaunch(CPanel *panel, HWND hWnd, LPCWSTR wszCmd)
Definition: control.c:873
HINSTANCE hInst
Definition: dxdiag.c:13
#define debugstr_w
Definition: kernel32.h:32
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cpanel.h:56
struct list applets
Definition: cpanel.h:57
Definition: ftp_var.h:139

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )

Variable Documentation

◆ ControlPanelSFHeader

const shvheader ControlPanelSFHeader[]
static
Initial value:
= {
}
#define IDS_SHV_COLUMN_NAME
Definition: resource.h:74
#define LVCFMT_LEFT
Definition: commctrl.h:2598
#define IDS_SHV_COLUMN_COMMENTS
Definition: shresdef.h:69
@ SHCOLSTATE_TYPE_STR
Definition: shtypes.idl:121
@ SHCOLSTATE_ONBYDEFAULT
Definition: shtypes.idl:125

Definition at line 50 of file CControlPanelFolder.cpp.

Referenced by CControlPanelFolder::GetDefaultColumnState(), and CControlPanelFolder::GetDetailsOf().