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; }
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; }