shell file/directory entry More...
#include <shellfs.h>
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, LPPOINT pptScreen, CtxMenuInterfaces &cm_ifs) |
virtual ShellFolder | get_shell_folder () const |
IShellFolder * | get_parent_folder () const |
Public Attributes | |
ShellPath | _pidl |
Protected Member Functions | |
ShellEntry (LPITEMIDLIST shell_path) | |
ShellEntry (const ShellPath &shell_path) |
shell file/directory entry
Definition at line 30 of file shellfs.h.
ShellEntry::ShellEntry | ( | Entry * | parent, |
LPITEMIDLIST | shell_path | ||
) | [inline] |
ShellEntry::ShellEntry | ( | LPITEMIDLIST | shell_path ) | [inline, protected] |
ShellEntry::ShellEntry | ( | const ShellPath & | shell_path ) | [inline, protected] |
ShellPath ShellEntry::create_absolute_pidl | ( | ) | const [virtual] |
Reimplemented from Entry.
Definition at line 120 of file shellfs.cpp.
References Entry::_etype, _pidl, Entry::_up, CONTEXT, Entry::create_absolute_pidl(), create_absolute_pidl(), ShellPath::create_absolute_pidl(), and ET_SHELL.
Referenced by create_absolute_pidl(), get_path(), ShellBrowser::jump_to(), and launch_entry().
{ CONTEXT("ShellEntry::create_absolute_pidl()"); if (_up) { if (_up->_etype == ET_SHELL) { ShellDirectory* dir = static_cast<ShellDirectory*>(_up); if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); } else return _pidl.create_absolute_pidl(_up->create_absolute_pidl()); } return _pidl; }
HRESULT ShellEntry::do_context_menu | ( | HWND | hwnd, |
LPPOINT | pptScreen, | ||
CtxMenuInterfaces & | cm_ifs | ||
) | [virtual] |
Definition at line 220 of file shellfs.cpp.
References ShellDirectory::_folder, _pidl, Entry::_up, GetDesktopFolder(), and ShellFolderContextMenu().
{ ShellDirectory* dir = static_cast<ShellDirectory*>(_up); ShellFolder folder = dir? dir->_folder: GetDesktopFolder(); LPCITEMIDLIST pidl = _pidl; return ShellFolderContextMenu(folder, hwnd, 1, &pidl, pptScreen->x, pptScreen->y, cm_ifs); }
IShellFolder * ShellEntry::get_parent_folder | ( | ) | const [inline] |
Definition at line 120 of file shellfs.h.
References Entry::_up, and GetDesktopFolder().
Referenced by ShellDirectory::get_path(), get_shell_folder(), and GetUIObjectOf().
{ if (_up) return static_cast<ShellDirectory*>(_up)->_folder; else return GetDesktopFolder(); }
bool ShellEntry::get_path | ( | PTSTR | path, |
size_t | path_count | ||
) | const [virtual] |
Implements Entry.
Reimplemented in ShellDirectory.
Definition at line 139 of file shellfs.cpp.
References create_absolute_pidl().
{ if (!path || path_count==0) return false; /* path[0] = TEXT('\0'); if (FAILED(path_from_pidl(get_parent_folder(), &*_pidl, path, path_count))) return false; */ FileSysShellPath fs_path(create_absolute_pidl()); LPCTSTR ret = fs_path; if (ret) { lstrcpyn(path, ret, path_count); return true; } else return false; }
ShellFolder ShellEntry::get_shell_folder | ( | ) | const [virtual] |
Reimplemented from Entry.
Reimplemented in ShellDirectory.
Definition at line 244 of file shellfs.cpp.
References get_parent_folder().
{ return get_parent_folder(); }
Reimplemented from Entry.
Definition at line 231 of file shellfs.cpp.
References _pidl, and get_parent_folder().
{ LPCITEMIDLIST pidl = _pidl; return get_parent_folder()->GetUIObjectOf(hWnd, 1, &pidl, riid, NULL, ppvOut); }
BOOL ShellEntry::launch_entry | ( | HWND | hwnd, |
UINT | nCmdShow = SW_SHOWNORMAL |
||
) | [virtual] |
Reimplemented from Entry.
Definition at line 188 of file shellfs.cpp.
References CONTEXT, create_absolute_pidl(), and display_error().
{ CONTEXT("ShellEntry::launch_entry()"); SHELLEXECUTEINFO shexinfo; shexinfo.cbSize = sizeof(SHELLEXECUTEINFO); shexinfo.fMask = SEE_MASK_INVOKEIDLIST; // SEE_MASK_IDLIST is also possible. shexinfo.hwnd = hwnd; shexinfo.lpVerb = NULL; shexinfo.lpFile = NULL; shexinfo.lpParameters = NULL; shexinfo.lpDirectory = NULL; shexinfo.nShow = nCmdShow; ShellPath shell_path = create_absolute_pidl(); shexinfo.lpIDList = &*shell_path; // add PIDL to the recent file list SHAddToRecentDocs(SHARD_PIDL, shexinfo.lpIDList); BOOL ret = TRUE; if (!ShellExecuteEx(&shexinfo)) { display_error(hwnd, GetLastError()); ret = FALSE; } return ret; }
Definition at line 44 of file shellfs.h.
Referenced by StartMenu::AddEntry(), create_absolute_pidl(), do_context_menu(), ShellDirectory::find_entry(), ShellDirectory::get_path(), and GetUIObjectOf().
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |