59#undef FCIDM_SHVIEWLAST
77#define SHV_CHANGE_NOTIFY (WM_USER + 0x1111)
78#define SHV_UPDATESTATUSBAR (WM_USER + 0x1112)
82#define CONTEXT_MENU_BASE_ID 1
87 static const UINT SIG = (
'R' << 0) | (
'O' << 8) | (
'S' << 16) | ((
'c') << 24);
95 static const UINT SIG = (
'R' << 0) | (
'O' << 8) | (
'S' << 16) | ((
'c' ^
'v' ^
's') << 24);
106 UINT cmf = CMF_NORMAL;
108 cmf |= CMF_EXTENDEDVERBS;
109 if (sfgao & SFGAO_CANRENAME)
110 cmf |= CMF_CANRENAME;
163 mii.
fType = MF & ~mii.fState;
221 public CWindowImpl<CDefView, CWindow, CControlWinTraits>,
225 public IShellFolderView,
457 DVTARGETDEVICE *ptd,
HDC hicTargetDev,
LOGPALETTE **ppColorSet)
override;
567#define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
568#define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
569#define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
611 TRACE(
" destroying IShellView(%p)\n",
this);
647 TRACE(
"ICommDlgBrowser::IncludeObject pidl=%p\n", pidl);
664 TRACE(
"ICommDlgBrowser::OnDefaultCommand\n");
678 TRACE(
"ICommDlgBrowser::OnStateChange flags=%x\n",
uFlags);
737 UINT64 uTotalFileSize = 0;
741 bool bIsOnlyFoldersSelected =
true;
757 bIsOnlyFoldersSelected =
false;
763 if ((cSelectedItems && !bIsOnlyFoldersSelected) || uTotalFileSize)
786 if (cSelectedItems > 0)
789 att = SFGAO_CANCOPY | SFGAO_CANMOVE;
811 DWORD dwStyle, dwExStyle, ListExStyle;
886 ListExStyle |= LVS_EX_HEADERINALLVIEWS;
890 dwExStyle &= ~WS_EX_CLIENTEDGE;
892 RECT rcListView = {0,0,0,0};
910 DWORD cbDropShadow =
sizeof(bDropShadow);
920 L"ListviewShadow",
NULL, &bDropShadow, &cbDropShadow);
996 if ((
UINT)
r == FoldCol)
1010 if (ListCol <
count)
1018 TRACE(
"m_ListToFolderColMap cache miss while mapping %d\n", ListCol);
1040 FIXME(
"Try SFVM_GETDETAILSOF\n");
1051 ERR(
"Unable to determine folder column from list column %d\n", (
int) ListCol);
1077 lvc.cx = ForceWidth ? ForceWidth : (
sd.cxChar * chavewidth);
1078 lvc.iSubItem = FoldCol;
1079 if ((
int)ListCol == -1)
1083 ListCol = 0x7fffffff;
1100 for (
i = 0, foldCol = 0;; ++foldCol)
1102 if (newColCount >= 0xffff)
1107 if (
i >= ColListCount)
1110 foldCol =
LOWORD(pColList[
i++]);
1130 bool insert = newColCount >= oldColCount;
1141 for (
i = newColCount;
i < oldColCount; ++
i)
1254 ERR(
"Sort column out of range\n");
1308 for (
int i = 0;
i < cItems;
i++)
1319 for (
i = 0;
i < cItems;
i++)
1335 TRACE(
"(%p)(pidl=%p)\n",
this, pidl);
1357 TRACE(
"(%p)(pidl=%p)\n",
this, pidl);
1375 TRACE(
"(%p)(pidlold=%p pidlnew=%p)\n",
this, pidlOld, pidlNew);
1384 lvItem.
iItem = nItem;
1392 lvItem.
iItem = nItem;
1414 TRACE(
"(%p)(pidl=%p)\n",
this, pidl);
1425 lvItem.
iItem = nItem;
1441 lvItem.
iItem = iItem;
1451 for (
INT iItem = -1;;)
1487 TRACE(
"%p\n",
this);
1496 dFlags |= SHCONTF_INCLUDEHIDDEN;
1501 dFlags |= SHCONTF_INCLUDESUPERHIDDEN;
1520 while((
S_OK == pEnumIDList->Next(1, &pidl, &dwFetched)) && dwFetched)
1700 TRACE(
"%p\n",
this);
1705 ERR(
"Error Registering DragDrop\n");
1734 if (
FAILED(
hr) || (!pidlTarget && !fEvents))
1744 ntreg.
pidl = pidlTarget;
1857 bool forceMerge =
false;
1926 const UINT maxItems = 15;
1927 const UINT idMore = 0x1337;
1928 UINT idFirst = idMore + 1, idLast = idFirst;
1929 UINT lastValidListCol = 0;
1938 pt.x =
r.left + ((
r.right -
r.left) / 2);
1939 pt.y =
r.top + ((
r.bottom -
r.top) / 2);
1946 for (
UINT foldCol = 0;; ++foldCol)
1975 lastValidListCol = listCol;
1978 if (idLast - idFirst == maxItems)
2000 if (idCmd == idMore)
2002 FIXME(
"Open More dialog\n");
2006 UINT foldCol = idCmd - idFirst;
2058 TRACE(
"-- selected Item found\n");
2066 CMINVOKECOMMANDINFOEX cmi;
2069 cmi.cbSize =
sizeof(cmi);
2071 cmi.lpVerb = lpVerb;
2075 cmi.fMask |= CMIC_MASK_SHIFT_DOWN;
2078 cmi.fMask |= CMIC_MASK_CONTROL_DOWN;
2082 cmi.fMask |= CMIC_MASK_PTINVOKE;
2092 cmi.fMask |= CMIC_MASK_UNICODE;
2093 cmi.lpDirectory = szDirA;
2094 cmi.lpDirectoryW = szDirW;
2097 HRESULT hr = pCM->InvokeCommand((LPCMINVOKECOMMANDINFO)&cmi);
2118 if (hResult ==
S_OK)
2137 if (uCommand == (
UINT)-1)
2139 ERR(
"GetMenuDefaultItem returned -1\n");
2154 TRACE(
"(%p)\n",
this);
2158 ERR(
"HACK: Aborting context menu in nested call\n");
2184 SelectItem(hittest.iItem, SVSI_SELECT | SVSI_DESELECTOTHERS | SVSI_ENSUREVISIBLE);
2245 pcdb2->Notify(
static_cast<IShellView*
>(
this), CDB2N_CONTEXTMENU_START);
2261 pcdb2->Notify(
static_cast<IShellView*
>(
this), CDB2N_CONTEXTMENU_DONE);
2291 SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
2317 WORD wWidth, wHeight;
2322 TRACE(
"%p width=%u height=%u\n",
this, wWidth, wHeight);
2342 TRACE(
"%p\n",
this);
2353 TRACE(
"%p uState=%x\n",
this, uState);
2390 SFGAOF rfg = SFGAO_CANCOPY | SFGAO_CANMOVE | SFGAO_FILESYSTEM;
2395 if (!bCopy && !(rfg & SFGAO_CANMOVE))
2397 if (bCopy && !(rfg & SFGAO_CANCOPY))
2416 TRACE(
"%p\n",
this);
2436 TRACE(
"(%p) stub\n",
this);
2457 TRACE(
"(%p)->(0x%08x 0x%08x %p) stub\n",
this, dwCmdID, dwCmd, hwndCmd);
2509 for (
int i=0;
i < nCount;
i++)
2556 cbValue =
sizeof(dwValue);
2577 TRACE(
"%p CtlID=%u lpnmh->code=%x\n",
this, CtlID, lpnmh->
code);
2579 switch (lpnmh->
code)
2582 TRACE(
"-- NM_SETFOCUS %p\n",
this);
2586 TRACE(
"-- NM_KILLFOCUS %p\n",
this);
2592 TRACE(
"-- NM_CUSTOMDRAW %p\n",
this);
2595 TRACE(
"-- NM_RELEASEDCAPTURE %p\n",
this);
2598 TRACE(
"-- NM_CLICK %p\n",
this);
2601 TRACE(
"-- NM_RCLICK %p\n",
this);
2604 TRACE(
"-- NM_DBLCLK %p\n",
this);
2608 TRACE(
"-- NM_RETURN %p\n",
this);
2612 TRACE(
"-- HDN_ENDTRACKW %p\n",
this);
2617 TRACE(
"-- LVN_DELETEITEM %p\n",
this);
2622 TRACE(
"-- LVN_DELETEALLITEMS %p\n",
this);
2625 TRACE(
"-- LVN_INSERTITEM (STUB)%p\n",
this);
2628 TRACE(
"-- LVN_ITEMACTIVATE %p\n",
this);
2645 TRACE(
"-- LVN_GETDISPINFO %p\n",
this);
2673 ULONG attributes = SFGAO_HIDDEN;
2676 if (attributes & SFGAO_HIDDEN)
2683 TRACE(
"-- LVN_ITEMCHANGED %p\n",
this);
2698 TRACE(
"-- LVN_BEGINDRAG\n");
2710 dwEffect |=
dwAttributes & (SFGAO_CANCOPY | SFGAO_CANLINK);
2714 piaso->SetAsyncMode(
TRUE);
2738 DWORD dwAttr = SFGAO_CANRENAME;
2741 TRACE(
"-- LVN_BEGINLABELEDITW %p\n",
this);
2744 if (SFGAO_CANRENAME & dwAttr)
2750 if (!(dwAttr & SFGAO_FOLDER) && (dwAttr & SFGAO_FILESYSTEM) &&
2780 TRACE(
"-- LVN_ENDLABELEDITW %p\n",
this);
2808 TRACE(
"-- %p WM_COMMAND %x unhandled\n",
this, lpnmh->
code);
2821 if (!pidl1 || !pidl2)
2844 ERR(
"hLock == NULL\n");
2848 TRACE(
"(%p)(%p,%p,%p)\n",
this, Pidls[0], Pidls[1],
lParam);
2873 lEvent &= ~SHCNE_INTERRUPT;
2894 if (child0 && child1)
2933 ERR(
"no context menu\n");
3023 TRACE(
"(%p)\n",
this);
3032 FIXME(
"(%p) stub\n",
this);
3056 FIXME(
"(%p)\n",
this);
3062 TRACE(
"(%p)->(state=%x)\n",
this, uState);
3085 TRACE(
"(%p)\n",
this);
3103 TRACE(
"(%p)\n",
this);
3151 TRACE(
"(%p)->(%p) vmode=%x flags=%x\n",
this, lpfs,
3215 bool fallback =
false;
3258 if (failed || !cols.
Count)
3334 hr = pStream->
Write(&cvs,
sizeof(cvs), &written);
3336 hr = pStream->
Write(&cols, cbColumns, &written);
3350#define UPDATEFOLDERVIEWFLAGS(bits, bit, set) ( (bits) = ((bits) & ~(bit)) | ((set) ? (bit) : 0) )
3362 TRACE(
"(%p)->(pidl=%p, 0x%08x) stub\n",
this, pidl,
uFlags);
3366 ERR(
"!m_ListView\n");
3382 if (
uFlags & SVSI_SELECT)
3385 lvItem.
state &= ~LVIS_SELECTED;
3387 if (
uFlags & SVSI_FOCUSED)
3390 lvItem.
state &= ~LVIS_FOCUSED;
3394 if (
uFlags & SVSI_DESELECTOTHERS)
3396 lvItem.
state &= ~LVIS_SELECTED;
3398 lvItem.
state &= ~LVIS_FOCUSED;
3405 if (
uFlags & SVSI_ENSUREVISIBLE)
3408 if((
uFlags & SVSI_EDIT) == SVSI_EDIT)
3459 TRACE(
"-- (%p)->(interface=%p)\n",
this, *ppvOut);
3475 TRACE(
"(%p)->(%p), stub\n",
this, pViewMode);
3487 TRACE(
"(%p)->(%u), stub\n",
this, ViewMode);
3513 FIXME(
"ViewMode %d not implemented\n", ViewMode);
3568 TRACE(
"(%p)->(%p)\n",
this, piItem);
3577 TRACE(
"(%p)->(%p)\n",
this, piItem);
3588 ERR(
"!m_ListView\n");
3593 if (lvIndex == -1 || ppt ==
NULL)
3602 TRACE(
"(%p)->(%p)\n",
this, ppt);
3606 ERR(
"!m_ListView\n");
3615 ppt->
x = spacing.
cx;
3616 ppt->
y = spacing.
cy;
3647 if (
dwFlags & SVSI_ENSUREVISIBLE)
3651 if (
dwFlags & SVSI_DESELECTOTHERS)
3663 if ((
dwFlags & SVSI_EDIT) == SVSI_EDIT)
3677 for (
UINT i = 0 ;
i < cidl;
i++)
3708 OLEMENUGROUPWIDTHS omw = { { 0, 0, 0, 0, 0, 0 } };
3714 TRACE(
"(%p)->(shlview=%p shlbrs=%p rec=%p hwnd=%p vmode=%x flags=%x)\n",
this, psvPrevious, psb, prcView,
hwnd,
mode,
flags);
3715 if (prcView !=
NULL)
3716 TRACE(
"-- left=%i top=%i right=%i bottom=%i\n", prcView->
left, prcView->
top, prcView->
right, prcView->
bottom);
3722 if (view_flags & ~SUPPORTED_SV3CVW3)
3723 FIXME(
"unsupported view flags 0x%08x\n", view_flags & ~SUPPORTED_SV3CVW3);