ReactOS 0.4.16-dev-401-g45b008d
ShellEntry Struct Reference

shell file/directory entry More...

#include <shellfs.h>

Inheritance diagram for ShellEntry:
Collaboration diagram for ShellEntry:

Public Member Functions

 ShellEntry (Entry *parent, LPITEMIDLIST shell_path)
 
 ShellEntry (Entry *parent, const ShellPath &shell_path)
 
virtual bool get_path (PTSTR path, size_t path_count) const
 
virtual ShellPath create_absolute_pidl () const
 
virtual HRESULT GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
 
virtual BOOL launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
 
virtual HRESULT do_context_menu (HWND hwnd, const POINT &pptScreen, CtxMenuInterfaces &cm_ifs)
 
virtual ShellFolder get_shell_folder () const
 
IShellFolderget_parent_folder () const
 
- Public Member Functions inherited from Entry
virtual ~Entry ()
 
void free_subentries ()
 
void read_directory_base (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
Entryread_tree (const void *path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
void sort_directory (SORT_ORDER sortOrder)
 
void smart_scan (SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
 
int extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
int safe_extract_icon (ICONCACHE_FLAGS flags=ICF_NORMAL)
 
virtual void read_directory (int scan_flags=0)
 
virtual const voidget_next_path_component (const void *) const
 
virtual Entryfind_entry (const void *)
 
virtual bool get_path (PTSTR path, size_t path_count) const =0
 
virtual ShellPath create_absolute_pidl () const
 
virtual HRESULT GetUIObjectOf (HWND hWnd, REFIID riid, LPVOID *ppvOut)
 
virtual ShellFolder get_shell_folder () const
 
virtual BOOL launch_entry (HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
 
virtual HRESULT do_context_menu (HWND hwnd, const POINT &pos, CtxMenuInterfaces &cm_ifs)
 

Public Attributes

ShellPath _pidl
 
- Public Attributes inherited from Entry
Entry_next
 
Entry_down
 
Entry_up
 
bool _expanded
 
bool _scanned
 
int _level
 
WIN32_FIND_DATA _data
 
SFGAOF _shell_attribs
 
LPTSTR _display_name
 
LPTSTR _type_name
 
LPTSTR _content
 
ENTRY_TYPE _etype
 
int _icon_id
 
BY_HANDLE_FILE_INFORMATION _bhfi
 
bool _bhfi_valid
 

Protected Member Functions

 ShellEntry (LPITEMIDLIST shell_path)
 
 ShellEntry (const ShellPath &shell_path)
 
- Protected Member Functions inherited from Entry
 Entry (ENTRY_TYPE etype)
 
 Entry (Entry *parent, ENTRY_TYPE etype)
 
 Entry (const Entry &)
 
bool get_path_base (PTSTR path, size_t path_count, ENTRY_TYPE etype) const
 

Detailed Description

shell file/directory entry

Definition at line 30 of file shellfs.h.

Constructor & Destructor Documentation

◆ ShellEntry() [1/4]

ShellEntry::ShellEntry ( Entry parent,
LPITEMIDLIST  shell_path 
)
inline

Definition at line 32 of file shellfs.h.

32: Entry(parent, ET_SHELL), _pidl(shell_path) {}
r parent
Definition: btrfs.c:3010
@ ET_SHELL
Definition: entries.h:37
base of all file and directory entries
Definition: entries.h:83
ShellPath _pidl
Definition: shellfs.h:44

◆ ShellEntry() [2/4]

ShellEntry::ShellEntry ( Entry parent,
const ShellPath shell_path 
)
inline

Definition at line 33 of file shellfs.h.

33: Entry(parent, ET_SHELL), _pidl(shell_path) {}

◆ ShellEntry() [3/4]

ShellEntry::ShellEntry ( LPITEMIDLIST  shell_path)
inlineprotected

Definition at line 47 of file shellfs.h.

47: Entry(ET_SHELL), _pidl(shell_path) {}

◆ ShellEntry() [4/4]

ShellEntry::ShellEntry ( const ShellPath shell_path)
inlineprotected

Definition at line 48 of file shellfs.h.

48: Entry(ET_SHELL), _pidl(shell_path) {}

Member Function Documentation

◆ create_absolute_pidl()

ShellPath ShellEntry::create_absolute_pidl ( ) const
virtual

Reimplemented from Entry.

Definition at line 114 of file shellfs.cpp.

115{
116 CONTEXT("ShellEntry::create_absolute_pidl()");
117
118 if (_up)
119 {
120 if (_up->_etype == ET_SHELL) {
121 ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
122
123 if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance.
124 return _pidl.create_absolute_pidl(dir->create_absolute_pidl());
125 } else
127 }
128 return _pidl;
129}
unsigned int dir
Definition: maze.c:112
struct _CONTEXT CONTEXT
ENTRY_TYPE _etype
Definition: entries.h:107
Entry * _up
Definition: entries.h:94
virtual ShellPath create_absolute_pidl() const
Definition: entries.h:126
shell folder entry
Definition: shellfs.h:54
ShellPath create_absolute_pidl(LPCITEMIDLIST parent_pidl) const

Referenced by get_path(), ShellBrowser::jump_to(), and launch_entry().

◆ do_context_menu()

HRESULT ShellEntry::do_context_menu ( HWND  hwnd,
const POINT pptScreen,
CtxMenuInterfaces cm_ifs 
)
virtual

Reimplemented from Entry.

Definition at line 218 of file shellfs.cpp.

219{
220 ShellDirectory* dir = static_cast<ShellDirectory*>(_up);
221
223 LPCITEMIDLIST pidl = _pidl;
224
225 return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen.x, pptScreen.y, cm_ifs);
226}
ShellFolder & GetDesktopFolder()
HRESULT ShellFolderContextMenu(IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y, CtxMenuInterfaces &cm_ifs)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
IShellFolder smart pointer.
Definition: shellclasses.h:594
Definition: fci.c:116
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

◆ get_parent_folder()

IShellFolder * ShellEntry::get_parent_folder ( ) const
inline

Definition at line 120 of file shellfs.h.

121{
122 if (_up)
123 return static_cast<ShellDirectory*>(_up)->_folder;
124 else
125 return GetDesktopFolder();
126}

Referenced by ShellDirectory::get_path(), get_shell_folder(), and GetUIObjectOf().

◆ get_path()

bool ShellEntry::get_path ( PTSTR  path,
size_t  path_count 
) const
virtual

Implements Entry.

Reimplemented in ShellDirectory.

Definition at line 133 of file shellfs.cpp.

134{
135 if (!path || path_count==0)
136 return false;
137/*
138 path[0] = TEXT('\0');
139
140 if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count)))
141 return false;
142*/
144 LPCTSTR ret = fs_path;
145
146 if (ret) {
147 lstrcpyn(path, ret, path_count);
148 return true;
149 } else
150 return false;
151}
Retrieval of file system paths of ShellPath objects.
Definition: shellclasses.h:933
virtual ShellPath create_absolute_pidl() const
Definition: shellfs.cpp:114
int ret
#define lstrcpyn
Definition: winbase.h:3900
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

◆ get_shell_folder()

ShellFolder ShellEntry::get_shell_folder ( ) const
virtual

Reimplemented from Entry.

Reimplemented in ShellDirectory.

Definition at line 242 of file shellfs.cpp.

243{
244 return get_parent_folder();
245}
IShellFolder * get_parent_folder() const
Definition: shellfs.h:120

◆ GetUIObjectOf()

HRESULT ShellEntry::GetUIObjectOf ( HWND  hWnd,
REFIID  riid,
LPVOID ppvOut 
)
virtual

Reimplemented from Entry.

Definition at line 229 of file shellfs.cpp.

230{
231 LPCITEMIDLIST pidl = _pidl;
232
233 return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut);
234}
HWND hWnd
Definition: settings.c:17
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
HRESULT GetUIObjectOf([in] HWND hwndOwner, [in] UINT cidl, [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl, [in] REFIID riid, [in, out, unique] UINT *prgfInOut, [out, iid_is(riid)] void **ppvOut)

◆ launch_entry()

BOOL ShellEntry::launch_entry ( HWND  hwnd,
UINT  nCmdShow = SW_SHOWNORMAL 
)
virtual

Reimplemented from Entry.

Definition at line 186 of file shellfs.cpp.

187{
188 CONTEXT("ShellEntry::launch_entry()");
189
190 SHELLEXECUTEINFO shexinfo;
191
192 shexinfo.cbSize = sizeof(SHELLEXECUTEINFO);
193 shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible.
194 shexinfo.hwnd = hwnd;
195 shexinfo.lpVerb = NULL;
196 shexinfo.lpFile = NULL;
197 shexinfo.lpParameters = NULL;
198 shexinfo.lpDirectory = NULL;
199 shexinfo.nShow = nCmdShow;
200
201 ShellPath shell_path = create_absolute_pidl();
202 shexinfo.lpIDList = &*shell_path;
203
204 // add PIDL to the recent file list
206
207 BOOL ret = TRUE;
208
209 if (!ShellExecuteEx(&shexinfo)) {
211 ret = FALSE;
212 }
213
214 return ret;
215}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
void display_error(HWND hwnd, DWORD error)
Definition: utility.cpp:98
#define ShellExecuteEx
Definition: shellapi.h:695
SHELLEXECUTEINFOA SHELLEXECUTEINFO
Definition: shellapi.h:682
#define SEE_MASK_INVOKEIDLIST
Definition: shellapi.h:28
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:1010
#define SHARD_PIDL
Definition: shlobj.h:1174
wrapper class for item ID lists
Definition: shellclasses.h:652
LPCSTR lpParameters
Definition: shellapi.h:317
LPCSTR lpDirectory
Definition: shellapi.h:318
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Member Data Documentation

◆ _pidl


The documentation for this struct was generated from the following files: