ShellPath ShellEntry::create_absolute_pidl() const { CONTEXT("ShellEntry::create_absolute_pidl()"); if (_up) { ShellDirectory* dir = _up; if (dir->_pidl->mkid.cb) // Caching of absolute PIDLs could enhance performance. return _pidl.create_absolute_pidl(dir->create_absolute_pidl()); } return _pidl; }
ShellPath ShellEntry::create_absolute_pidl() const { 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 ShellBrowser::OnDefaultCommand(LPIDA pida) { CONTEXT("ShellBrowser::OnDefaultCommand()"); if (pida->cidl >= 1) { if (_left_hwnd) { // explorer mode if (_last_sel) { ShellDirectory* parent = (ShellDirectory*)TreeView_GetItemData(_left_hwnd, _last_sel); if (parent) { try { parent->smart_scan(SORT_NAME, SCAN_DONT_ACCESS); } catch(COMException& e) { return e.Error(); } UINT firstOffset = pida->aoffset[1]; LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset); Entry* entry = parent->find_entry(pidl); if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) if (entry->_etype == ET_SHELL) if (_last_sel && select_entry(_last_sel, entry)) return S_OK; ///@todo look for hidden or new subfolders and refresh/add new entry instead of opening a new window return E_NOTIMPL; } } } else { // no tree control if (MainFrameBase::OpenShellFolders(pida, _hwndFrame)) return S_OK; /* create new Frame Window if (MainFrame::OpenShellFolders(pida, 0)) return S_OK; */ } } return E_NOTIMPL; }
void ShellDirectory::read_directory(SORT_ORDER sortOrder, int scan_flags) { CONTEXT("ShellEntry::read_directory(SORT_ORDER)"); // call into subclass read_directory(scan_flags); #ifndef ROSSHELL if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should not be used for reading the start menu. for(ShellEntry*entry=_down; entry; entry=entry->_next) if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { ShellDirectory* dir = static_cast<ShellDirectory*>(entry); dir->read_directory(scan_flags); dir->sort_directory(sortOrder); } } #endif sort_directory(sortOrder); }
HRESULT ShellBrowserChild::OnDefaultCommand(LPIDA pida) { CONTEXT("ShellBrowserChild::OnDefaultCommand()"); if (pida->cidl >= 1) { if (_left_hwnd) { // explorer mode ShellDirectory* parent = _cur_dir; if (parent) { try { parent->smart_scan(); } catch(COMException& e) { return e.Error(); } UINT firstOffset = pida->aoffset[1]; LPITEMIDLIST pidl = (LPITEMIDLIST)((LPBYTE)pida+firstOffset); ShellEntry* entry = parent->find_entry(pidl); if (entry && (entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) if (select_folder(static_cast<ShellDirectory*>(entry), true)) return S_OK; } } else { // no tree control if (MainFrame::OpenShellFolders(pida, _hWndFrame)) return S_OK; /* create new Frame Window if (MainFrame::OpenShellFolders(pida, 0)) return S_OK; */ } } return E_NOTIMPL; }