4 * Copyright 1998,1999 <juergen.schmied@debitel.net>
6 * This is the view visualizing the data provied by the shellfolder.
7 * No direct access to data from pidls should be done from here.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * FIXME: The order by part of the background context menu should be
24 * buily according to the columns shown.
26 * FIXME: Load/Save the view state from/into the stream provied by
29 * FIXME: CheckToolbar: handle the "new folder" and "folder up" button
31 * FIXME: ShellView_FillList: consider sort orders
33 * FIXME: implement the drag and drop in the old (msg-based) way
35 * FIXME: when the ShellView_WndProc gets a WM_NCDESTROY should we do a
40 #include "wine/port.h"
46 #define NONAMELESSUNION
47 #define NONAMELESSSTRUCT
57 #include "undocshell.h"
59 #include "wine/debug.h"
63 #include "shell32_main.h"
64 #include "shellfolder.h"
66 WINE_DEFAULT_DEBUG_CHANNEL(shell);
72 }LISTVIEW_SORT_INFO, *LPLISTVIEW_SORT_INFO;
75 { ICOM_VFIELD(IShellView);
77 ICOM_VTABLE(IOleCommandTarget)* lpvtblOleCommandTarget;
78 ICOM_VTABLE(IDropTarget)* lpvtblDropTarget;
79 ICOM_VTABLE(IDropSource)* lpvtblDropSource;
80 ICOM_VTABLE(IViewObject)* lpvtblViewObject;
81 IShellFolder* pSFParent;
82 IShellFolder2* pSF2Parent;
83 IShellBrowser* pShellBrowser;
84 ICommDlgBrowser* pCommDlgBrowser;
85 HWND hWnd; /* SHELLDLL_DefView */
86 HWND hWndList; /* ListView control */
88 FOLDERSETTINGS FolderSettings;
93 LISTVIEW_SORT_INFO ListViewSortInfo;
94 ULONG hNotify; /* change notification handle */
98 static struct ICOM_VTABLE(IShellView) svvt;
100 static struct ICOM_VTABLE(IOleCommandTarget) ctvt;
101 #define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget)))
102 #define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset);
104 static struct ICOM_VTABLE(IDropTarget) dtvt;
105 #define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget)))
106 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
108 static struct ICOM_VTABLE(IDropSource) dsvt;
109 #define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource)))
110 #define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset);
112 static struct ICOM_VTABLE(IViewObject) vovt;
113 #define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject)))
114 #define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset);
116 /* ListView Header ID's */
117 #define LISTVIEW_COLUMN_NAME 0
118 #define LISTVIEW_COLUMN_SIZE 1
119 #define LISTVIEW_COLUMN_TYPE 2
120 #define LISTVIEW_COLUMN_TIME 3
121 #define LISTVIEW_COLUMN_ATTRIB 4
124 #define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
125 #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
126 #define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
128 #define ID_LISTVIEW 2000
130 #define SHV_CHANGE_NOTIFY WM_USER + 0x1111
133 #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
134 #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
135 #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
137 extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
138 UINT wID, UINT fType, LPSTR dwTypeData, UINT fState);
141 Items merged into the toolbar and and the filemenu
150 } MYTOOLINFO, *LPMYTOOLINFO;
154 { FCIDM_SHVIEW_BIGICON, 0, 0, IDS_VIEW_LARGE, TBSTATE_ENABLED, BTNS_BUTTON },
155 { FCIDM_SHVIEW_SMALLICON, 0, 0, IDS_VIEW_SMALL, TBSTATE_ENABLED, BTNS_BUTTON },
156 { FCIDM_SHVIEW_LISTVIEW, 0, 0, IDS_VIEW_LIST, TBSTATE_ENABLED, BTNS_BUTTON },
157 { FCIDM_SHVIEW_REPORTVIEW, 0, 0, IDS_VIEW_DETAILS, TBSTATE_ENABLED, BTNS_BUTTON },
161 typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
163 /**********************************************************
164 * IShellView_Constructor
166 IShellView * IShellView_Constructor( IShellFolder * pFolder)
167 { IShellViewImpl * sv;
168 sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
171 sv->lpvtblOleCommandTarget=&ctvt;
172 sv->lpvtblDropTarget=&dtvt;
173 sv->lpvtblDropSource=&dsvt;
174 sv->lpvtblViewObject=&vovt;
176 sv->pSFParent = pFolder;
177 if(pFolder) IShellFolder_AddRef(pFolder);
178 IShellFolder_QueryInterface(sv->pSFParent, &IID_IShellFolder2, (LPVOID*)&sv->pSF2Parent);
180 TRACE("(%p)->(%p)\n",sv, pFolder);
181 return (IShellView *) sv;
184 /**********************************************************
186 * ##### helperfunctions for communication with ICommDlgBrowser #####
188 static BOOL IsInCommDlg(IShellViewImpl * This)
189 { return(This->pCommDlgBrowser != NULL);
192 static HRESULT IncludeObject(IShellViewImpl * This, LPCITEMIDLIST pidl)
196 if ( IsInCommDlg(This) )
198 TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl);
199 ret = ICommDlgBrowser_IncludeObject(This->pCommDlgBrowser, (IShellView*)This, pidl);
200 TRACE("--0x%08lx\n", ret);
205 static HRESULT OnDefaultCommand(IShellViewImpl * This)
207 HRESULT ret = S_FALSE;
209 if (IsInCommDlg(This))
211 TRACE("ICommDlgBrowser::OnDefaultCommand\n");
212 ret = ICommDlgBrowser_OnDefaultCommand(This->pCommDlgBrowser, (IShellView*)This);
218 static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags)
220 HRESULT ret = S_FALSE;
222 if (IsInCommDlg(This))
224 TRACE("ICommDlgBrowser::OnStateChange flags=%x\n", uFlags);
225 ret = ICommDlgBrowser_OnStateChange(This->pCommDlgBrowser, (IShellView*)This, uFlags);
230 /**********************************************************
231 * set the toolbar of the filedialog buttons
233 * - activates the buttons from the shellbrowser according to
236 static void CheckToolbar(IShellViewImpl * This)
242 if (IsInCommDlg(This))
244 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
245 FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result);
246 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
247 FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result);
248 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
249 FCIDM_TB_SMALLICON, TRUE, &result);
250 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
251 FCIDM_TB_REPORTVIEW, TRUE, &result);
255 /**********************************************************
257 * ##### helperfunctions for initializing the view #####
259 /**********************************************************
260 * change the style of the listview control
262 static void SetStyle(IShellViewImpl * This, DWORD dwAdd, DWORD dwRemove)
266 TRACE("(%p)\n", This);
268 tmpstyle = GetWindowLongA(This->hWndList, GWL_STYLE);
269 SetWindowLongA(This->hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove));
272 /**********************************************************
273 * ShellView_CreateList()
275 * - creates the list view window
277 static BOOL ShellView_CreateList (IShellViewImpl * This)
278 { DWORD dwStyle, dwExStyle;
282 dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
283 LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_ALIGNLEFT | LVS_AUTOARRANGE;
284 dwExStyle = WS_EX_CLIENTEDGE;
286 switch (This->FolderSettings.ViewMode)
288 case FVM_ICON: dwStyle |= LVS_ICON; break;
289 case FVM_DETAILS: dwStyle |= LVS_REPORT; break;
290 case FVM_SMALLICON: dwStyle |= LVS_SMALLICON; break;
291 case FVM_LIST: dwStyle |= LVS_LIST; break;
292 default: dwStyle |= LVS_LIST; break;
295 if (This->FolderSettings.fFlags & FWF_AUTOARRANGE) dwStyle |= LVS_AUTOARRANGE;
296 if (This->FolderSettings.fFlags & FWF_DESKTOP)
297 This->FolderSettings.fFlags |= FWF_NOCLIENTEDGE | FWF_NOSCROLL;
298 if (This->FolderSettings.fFlags & FWF_SINGLESEL) dwStyle |= LVS_SINGLESEL;
299 if (This->FolderSettings.fFlags & FWF_NOCLIENTEDGE)
300 dwExStyle &= ~WS_EX_CLIENTEDGE;
302 This->hWndList=CreateWindowExA( dwExStyle,
315 This->ListViewSortInfo.bIsAscending = TRUE;
316 This->ListViewSortInfo.nHeaderID = -1;
317 This->ListViewSortInfo.nLastHeaderID = -1;
319 if (This->FolderSettings.fFlags & FWF_DESKTOP) {
320 if (0) /* FIXME: look into registry vale HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ListviewShadow and activate drop shadows */
321 ListView_SetTextBkColor(This->hWndList, CLR_NONE);
323 ListView_SetTextBkColor(This->hWndList, GetSysColor(COLOR_DESKTOP));
325 ListView_SetTextColor(This->hWndList, RGB(255,255,255));
328 /* UpdateShellSettings(); */
332 /**********************************************************
333 * ShellView_InitList()
335 * - adds all needed columns to the shellview
337 static BOOL ShellView_InitList(IShellViewImpl * This)
346 ListView_DeleteAllItems(This->hWndList);
348 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
349 lvColumn.pszText = szTemp;
351 if (This->pSF2Parent)
355 if (!SUCCEEDED(IShellFolder2_GetDetailsOf(This->pSF2Parent, NULL, i, &sd)))
357 lvColumn.fmt = sd.fmt;
358 lvColumn.cx = sd.cxChar*8; /* chars->pixel */
359 StrRetToStrNA( szTemp, 50, &sd.str, NULL);
360 ListView_InsertColumnA(This->hWndList, i, &lvColumn);
368 ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL);
369 ListView_SetImageList(This->hWndList, ShellBigIconList, LVSIL_NORMAL);
373 /**********************************************************
374 * ShellView_CompareItems()
377 * internal, CALLBACK for DSA_Sort
379 static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
382 TRACE("pidl1=%p pidl2=%p lpsf=%p\n", lParam1, lParam2, (LPVOID) lpData);
384 if(!lpData) return 0;
386 ret = (SHORT) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER)lpData, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2));
387 TRACE("ret=%i\n",ret);
391 /*************************************************************************
392 * ShellView_ListViewCompareItems
394 * Compare Function for the Listview (FileOpen Dialog)
397 * lParam1 [I] the first ItemIdList to compare with
398 * lParam2 [I] the second ItemIdList to compare with
399 * lpData [I] The column ID for the header Ctrl to process
402 * A negative value if the first item should precede the second,
403 * a positive value if the first item should follow the second,
404 * or zero if the two items are equivalent
407 * FIXME: function does what ShellView_CompareItems is supposed to do.
408 * unify it and figure out how to use the undocumented first parameter
409 * of IShellFolder_CompareIDs to do the job this function does and
410 * move this code to IShellFolder.
411 * make LISTVIEW_SORT_INFO obsolete
412 * the way this function works is only usable if we had only
413 * filesystemfolders (25/10/99 jsch)
415 static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
419 char strName1[MAX_PATH], strName2[MAX_PATH];
420 BOOL bIsFolder1, bIsFolder2,bIsBothFolder;
421 LPITEMIDLIST pItemIdList1 = (LPITEMIDLIST) lParam1;
422 LPITEMIDLIST pItemIdList2 = (LPITEMIDLIST) lParam2;
423 LISTVIEW_SORT_INFO *pSortInfo = (LPLISTVIEW_SORT_INFO) lpData;
426 bIsFolder1 = _ILIsFolder(pItemIdList1);
427 bIsFolder2 = _ILIsFolder(pItemIdList2);
428 bIsBothFolder = bIsFolder1 && bIsFolder2;
430 /* When sorting between a File and a Folder, the Folder gets sorted first */
431 if( (bIsFolder1 || bIsFolder2) && !bIsBothFolder)
433 nDiff = bIsFolder1 ? -1 : 1;
437 /* Sort by Time: Folders or Files can be sorted */
439 if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_TIME)
441 _ILGetFileDateTime(pItemIdList1, &fd1);
442 _ILGetFileDateTime(pItemIdList2, &fd2);
443 nDiff = CompareFileTime(&fd2, &fd1);
445 /* Sort by Attribute: Folder or Files can be sorted */
446 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_ATTRIB)
448 _ILGetFileAttributes(pItemIdList1, strName1, MAX_PATH);
449 _ILGetFileAttributes(pItemIdList2, strName2, MAX_PATH);
450 nDiff = strcasecmp(strName1, strName2);
452 /* Sort by FileName: Folder or Files can be sorted */
453 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_NAME || bIsBothFolder)
456 _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
457 _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
458 nDiff = strcasecmp(strName1, strName2);
460 /* Sort by File Size, Only valid for Files */
461 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_SIZE)
463 nDiff = (INT)(_ILGetFileSize(pItemIdList1, NULL, 0) - _ILGetFileSize(pItemIdList2, NULL, 0));
465 /* Sort by File Type, Only valid for Files */
466 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_TYPE)
469 _ILGetFileType(pItemIdList1, strName1, MAX_PATH);
470 _ILGetFileType(pItemIdList2, strName2, MAX_PATH);
471 nDiff = strcasecmp(strName1, strName2);
474 /* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */
478 _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
479 _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
480 nDiff = strcasecmp(strName1, strName2);
483 if(!pSortInfo->bIsAscending)
492 /**********************************************************
493 * LV_FindItemByPidl()
495 static int LV_FindItemByPidl(
496 IShellViewImpl * This,
500 ZeroMemory(&lvItem, sizeof(LVITEMA));
501 lvItem.mask = LVIF_PARAM;
502 for(lvItem.iItem = 0; ListView_GetItemA(This->hWndList, &lvItem); lvItem.iItem++)
504 LPITEMIDLIST currentpidl = (LPITEMIDLIST) lvItem.lParam;
505 HRESULT hr = IShellFolder_CompareIDs(This->pSFParent, 0, pidl, currentpidl);
506 if(SUCCEEDED(hr) && !HRESULT_CODE(hr))
514 /**********************************************************
517 static BOOLEAN LV_AddItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
521 TRACE("(%p)(pidl=%p)\n", This, pidl);
523 ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listview item*/
524 lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/
525 lvItem.iItem = ListView_GetItemCount(This->hWndList); /*add the item to the end of the list*/
526 lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidl)); /*set the item's data*/
527 lvItem.pszText = LPSTR_TEXTCALLBACKA; /*get text on a callback basis*/
528 lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
529 return (-1==ListView_InsertItemA(This->hWndList, &lvItem))? FALSE: TRUE;
532 /**********************************************************
535 static BOOLEAN LV_DeleteItem(IShellViewImpl * This, LPCITEMIDLIST pidl)
539 TRACE("(%p)(pidl=%p)\n", This, pidl);
541 nIndex = LV_FindItemByPidl(This, ILFindLastID(pidl));
542 return (-1==ListView_DeleteItem(This->hWndList, nIndex))? FALSE: TRUE;
545 /**********************************************************
548 static BOOLEAN LV_RenameItem(IShellViewImpl * This, LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew )
553 TRACE("(%p)(pidlold=%p pidlnew=%p)\n", This, pidlOld, pidlNew);
555 nItem = LV_FindItemByPidl(This, ILFindLastID(pidlOld));
558 ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listview item*/
559 lvItem.mask = LVIF_PARAM; /* only the pidl */
560 lvItem.iItem = nItem;
561 ListView_GetItemA(This->hWndList, &lvItem);
563 SHFree((LPITEMIDLIST)lvItem.lParam);
564 lvItem.mask = LVIF_PARAM;
565 lvItem.iItem = nItem;
566 lvItem.lParam = (LPARAM) ILClone(ILFindLastID(pidlNew)); /* set the item's data */
567 ListView_SetItemA(This->hWndList, &lvItem);
568 ListView_Update(This->hWndList, nItem);
569 return TRUE; /* FIXME: better handling */
573 /**********************************************************
574 * ShellView_FillList()
576 * - gets the objectlist from the shellfolder
578 * - fills the list into the view
581 static INT CALLBACK fill_list( LPVOID ptr, LPVOID arg )
583 LPITEMIDLIST pidl = ptr;
584 IShellViewImpl *This = arg;
585 /* in a commdlg This works as a filemask*/
586 if ( IncludeObject(This, pidl)==S_OK ) LV_AddItem(This, pidl);
591 static HRESULT ShellView_FillList(IShellViewImpl * This)
593 LPENUMIDLIST pEnumIDList;
601 /* get the itemlist from the shfolder*/
602 hRes = IShellFolder_EnumObjects(This->pSFParent,This->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList);
610 /* create a pointer array */
611 hdpa = DPA_Create(16);
614 return(E_OUTOFMEMORY);
617 /* copy the items into the array*/
618 while((S_OK == IEnumIDList_Next(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched)
620 if (DPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
627 DPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent);
629 /*turn the listview's redrawing off*/
630 SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0);
632 DPA_DestroyCallback( hdpa, fill_list, This );
634 /*turn the listview's redrawing back on and force it to draw*/
635 SendMessageA(This->hWndList, WM_SETREDRAW, TRUE, 0);
637 IEnumIDList_Release(pEnumIDList); /* destroy the list*/
642 /**********************************************************
643 * ShellView_OnCreate()
645 static LRESULT ShellView_OnCreate(IShellViewImpl * This)
648 SHChangeNotifyEntry ntreg;
649 IPersistFolder2 * ppf2 = NULL;
653 if(ShellView_CreateList(This))
655 if(ShellView_InitList(This))
657 ShellView_FillList(This);
661 if (SUCCEEDED(IShellFolder_CreateViewObject(This->pSFParent, This->hWnd, &IID_IDropTarget, (LPVOID*)&pdt)))
663 RegisterDragDrop(This->hWnd, pdt);
664 IDropTarget_Release(pdt);
667 /* register for receiving notifications */
668 IShellFolder_QueryInterface(This->pSFParent, &IID_IPersistFolder2, (LPVOID*)&ppf2);
671 IPersistFolder2_GetCurFolder(ppf2, (LPITEMIDLIST*)&ntreg.pidl);
672 ntreg.fRecursive = TRUE;
673 This->hNotify = SHChangeNotifyRegister(This->hWnd, SHCNF_IDLIST, SHCNE_ALLEVENTS, SHV_CHANGE_NOTIFY, 1, &ntreg);
674 SHFree((LPITEMIDLIST)ntreg.pidl);
675 IPersistFolder2_Release(ppf2);
678 This->hAccel = LoadAcceleratorsA(shell32_hInstance, "shv_accel");
683 /**********************************************************
684 * #### Handling of the menus ####
687 /**********************************************************
688 * ShellView_BuildFileMenu()
690 static HMENU ShellView_BuildFileMenu(IShellViewImpl * This)
691 { CHAR szText[MAX_PATH];
696 TRACE("(%p)\n",This);
698 hSubMenu = CreatePopupMenu();
700 { /*get the number of items in our global array*/
701 for(nTools = 0; Tools[nTools].idCommand != -1; nTools++){}
703 /*add the menu items*/
704 for(i = 0; i < nTools; i++)
706 LoadStringA(shell32_hInstance, Tools[i].idMenuString, szText, MAX_PATH);
708 ZeroMemory(&mii, sizeof(mii));
709 mii.cbSize = sizeof(mii);
710 mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
712 if(BTNS_SEP != Tools[i].bStyle) /* no separator*/
714 mii.fType = MFT_STRING;
715 mii.fState = MFS_ENABLED;
716 mii.dwTypeData = szText;
717 mii.wID = Tools[i].idCommand;
721 mii.fType = MFT_SEPARATOR;
723 /* tack This item onto the end of the menu */
724 InsertMenuItemA(hSubMenu, (UINT)-1, TRUE, &mii);
727 TRACE("-- return (menu=%p)\n",hSubMenu);
730 /**********************************************************
731 * ShellView_MergeFileMenu()
733 static void ShellView_MergeFileMenu(IShellViewImpl * This, HMENU hSubMenu)
734 { TRACE("(%p)->(submenu=%p) stub\n",This,hSubMenu);
737 { /*insert This item at the beginning of the menu */
738 _InsertMenuItem(hSubMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED);
739 _InsertMenuItem(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, "dummy45", MFS_ENABLED);
745 /**********************************************************
746 * ShellView_MergeViewMenu()
749 static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu)
752 TRACE("(%p)->(submenu=%p)\n",This,hSubMenu);
755 { /*add a separator at the correct position in the menu*/
756 _InsertMenuItem(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED);
758 ZeroMemory(&mii, sizeof(mii));
759 mii.cbSize = sizeof(mii);
760 mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;
761 mii.fType = MFT_STRING;
762 mii.dwTypeData = "View";
763 mii.hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001");
764 InsertMenuItemA(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii);
768 /**********************************************************
769 * ShellView_GetSelections()
771 * - fills the this->apidl list with the selected objects
774 * number of selected items
776 static UINT ShellView_GetSelections(IShellViewImpl * This)
786 This->cidl = ListView_GetSelectedCount(This->hWndList);
787 This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
789 TRACE("selected=%i\n", This->cidl);
793 TRACE("-- Items selected =%u\n", This->cidl);
795 ZeroMemory(&lvItem, sizeof(lvItem));
796 lvItem.mask = LVIF_STATE | LVIF_PARAM;
797 lvItem.stateMask = LVIS_SELECTED;
799 while(ListView_GetItemA(This->hWndList, &lvItem) && (i < This->cidl))
801 if(lvItem.state & LVIS_SELECTED)
803 This->apidl[i] = (LPITEMIDLIST)lvItem.lParam;
805 TRACE("-- selected Item found\n");
814 /**********************************************************
815 * ShellView_OpenSelectedItems()
817 static HRESULT ShellView_OpenSelectedItems(IShellViewImpl * This)
819 static UINT CF_IDLIST = 0;
821 IDataObject* selection;
825 LPCITEMIDLIST parent_pidl;
828 if (0 == ShellView_GetSelections(This))
832 hr = IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl,
833 (LPCITEMIDLIST*)This->apidl, &IID_IDataObject,
834 0, (LPVOID *)&selection);
840 CF_IDLIST = RegisterClipboardFormatA(CFSTR_SHELLIDLIST);
842 fetc.cfFormat = CF_IDLIST;
844 fetc.dwAspect = DVASPECT_CONTENT;
846 fetc.tymed = TYMED_HGLOBAL;
848 hr = IDataObject_QueryGetData(selection, &fetc);
852 hr = IDataObject_GetData(selection, &fetc, &stgm);
856 pIDList = GlobalLock(stgm.u.hGlobal);
858 parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pIDList+pIDList->aoffset[0]);
859 for (i = pIDList->cidl; i > 0; --i)
864 pidl = (LPCITEMIDLIST)((LPBYTE)pIDList+pIDList->aoffset[i]);
866 attribs = SFGAO_FOLDER;
867 hr = IShellFolder_GetAttributesOf(This->pSFParent, 1, &pidl, &attribs);
869 if (SUCCEEDED(hr) && ! (attribs & SFGAO_FOLDER))
871 SHELLEXECUTEINFOA shexinfo;
873 shexinfo.cbSize = sizeof(SHELLEXECUTEINFOA);
874 shexinfo.fMask = SEE_MASK_INVOKEIDLIST; /* SEE_MASK_IDLIST is also possible. */
875 shexinfo.hwnd = NULL;
876 shexinfo.lpVerb = NULL;
877 shexinfo.lpFile = NULL;
878 shexinfo.lpParameters = NULL;
879 shexinfo.lpDirectory = NULL;
880 shexinfo.nShow = SW_NORMAL;
881 shexinfo.lpIDList = ILCombine(parent_pidl, pidl);
883 ShellExecuteExA(&shexinfo); /* Discard error/success info */
885 ILFree((LPITEMIDLIST)shexinfo.lpIDList);
889 GlobalUnlock(stgm.u.hGlobal);
890 ReleaseStgMedium(&stgm);
892 IDataObject_Release(selection);
897 /**********************************************************
898 * ShellView_DoContextMenu()
900 static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL bDefault)
904 BOOL fExplore = FALSE;
906 LPCONTEXTMENU pContextMenu = NULL;
907 IContextMenu2 *pCM = NULL;
908 CMINVOKECOMMANDINFO cmi;
910 TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This, x, y, bDefault);
912 /* look, what's selected and create a context menu object of it*/
913 if( ShellView_GetSelections(This) )
915 IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, (LPCITEMIDLIST*)This->apidl,
916 (REFIID)&IID_IContextMenu, NULL, (LPVOID *)&pContextMenu);
920 TRACE("-- pContextMenu\n");
921 hMenu = CreatePopupMenu();
925 /* See if we are in Explore or Open mode. If the browser's tree is present, we are in Explore mode.*/
926 if(SUCCEEDED(IShellBrowser_GetControlWindow(This->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree)
928 TRACE("-- explore mode\n");
932 /* build the flags depending on what we can do with the selected item */
933 wFlags = CMF_NORMAL | (This->cidl != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0);
935 /* let the ContextMenu merge its items in */
936 if (SUCCEEDED(IContextMenu_QueryContextMenu( pContextMenu, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, wFlags )))
938 if (This->FolderSettings.fFlags & FWF_DESKTOP)
939 SetMenuDefaultItem(hMenu, FCIDM_SHVIEW_OPEN, MF_BYCOMMAND);
943 TRACE("-- get menu default command\n");
944 uCommand = GetMenuDefaultItem(hMenu, FALSE, GMDI_GOINTOPOPUPS);
948 TRACE("-- track popup\n");
949 uCommand = TrackPopupMenu( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL);
954 TRACE("-- uCommand=%u\n", uCommand);
955 if (uCommand==FCIDM_SHVIEW_OPEN && IsInCommDlg(This))
957 TRACE("-- dlg: OnDefaultCommand\n");
958 if (FAILED(OnDefaultCommand(This)))
960 ShellView_OpenSelectedItems(This);
965 TRACE("-- explore -- invoke command\n");
966 ZeroMemory(&cmi, sizeof(cmi));
967 cmi.cbSize = sizeof(cmi);
968 cmi.hwnd = This->hWndParent; /* this window has to answer CWM_GETISHELLBROWSER */
969 cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand);
970 IContextMenu_InvokeCommand(pContextMenu, &cmi);
977 IContextMenu_Release(pContextMenu);
980 else /* background context menu */
982 hMenu = CreatePopupMenu();
984 pCM = ISvBgCm_Constructor(This->pSFParent);
985 IContextMenu2_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0);
987 uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL);
990 TRACE("-- (%p)->(uCommand=0x%08x )\n",This, uCommand);
992 ZeroMemory(&cmi, sizeof(cmi));
993 cmi.cbSize = sizeof(cmi);
994 cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand);
995 cmi.hwnd = This->hWndParent;
996 IContextMenu2_InvokeCommand(pCM, &cmi);
998 IContextMenu2_Release(pCM);
1002 /**********************************************************
1003 * ##### message handling #####
1006 /**********************************************************
1007 * ShellView_OnSize()
1009 static LRESULT ShellView_OnSize(IShellViewImpl * This, WORD wWidth, WORD wHeight)
1011 TRACE("%p width=%u height=%u\n",This, wWidth,wHeight);
1013 /*resize the ListView to fit our window*/
1016 MoveWindow(This->hWndList, 0, 0, wWidth, wHeight, TRUE);
1021 /**********************************************************
1022 * ShellView_OnDeactivate()
1027 static void ShellView_OnDeactivate(IShellViewImpl * This)
1031 if(This->uState != SVUIA_DEACTIVATE)
1035 IShellBrowser_SetMenuSB(This->pShellBrowser,0, 0, 0);
1036 IShellBrowser_RemoveMenusSB(This->pShellBrowser,This->hMenu);
1037 DestroyMenu(This->hMenu);
1041 This->uState = SVUIA_DEACTIVATE;
1045 /**********************************************************
1046 * ShellView_OnActivate()
1048 static LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState)
1049 { OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} };
1051 CHAR szText[MAX_PATH];
1053 TRACE("%p uState=%x\n",This,uState);
1055 /*don't do anything if the state isn't really changing */
1056 if(This->uState == uState)
1061 ShellView_OnDeactivate(This);
1063 /*only do This if we are active */
1064 if(uState != SVUIA_DEACTIVATE)
1066 /*merge the menus */
1067 This->hMenu = CreateMenu();
1071 IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw);
1072 TRACE("-- after fnInsertMenusSB\n");
1074 /*build the top level menu get the menu item's text*/
1075 strcpy(szText,"dummy 31");
1077 ZeroMemory(&mii, sizeof(mii));
1078 mii.cbSize = sizeof(mii);
1079 mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_STATE;
1080 mii.fType = MFT_STRING;
1081 mii.fState = MFS_ENABLED;
1082 mii.dwTypeData = szText;
1083 mii.hSubMenu = ShellView_BuildFileMenu(This);
1085 /*insert our menu into the menu bar*/
1088 InsertMenuItemA(This->hMenu, FCIDM_MENU_HELP, FALSE, &mii);
1091 /*get the view menu so we can merge with it*/
1092 ZeroMemory(&mii, sizeof(mii));
1093 mii.cbSize = sizeof(mii);
1094 mii.fMask = MIIM_SUBMENU;
1096 if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_VIEW, FALSE, &mii))
1098 ShellView_MergeViewMenu(This, mii.hSubMenu);
1101 /*add the items that should only be added if we have the focus*/
1102 if(SVUIA_ACTIVATE_FOCUS == uState)
1104 /*get the file menu so we can merge with it */
1105 ZeroMemory(&mii, sizeof(mii));
1106 mii.cbSize = sizeof(mii);
1107 mii.fMask = MIIM_SUBMENU;
1109 if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_FILE, FALSE, &mii))
1111 ShellView_MergeFileMenu(This, mii.hSubMenu);
1114 TRACE("-- before fnSetMenuSB\n");
1115 IShellBrowser_SetMenuSB(This->pShellBrowser, This->hMenu, 0, This->hWnd);
1118 This->uState = uState;
1123 /**********************************************************
1124 * ShellView_OnSetFocus()
1127 static LRESULT ShellView_OnSetFocus(IShellViewImpl * This)
1131 /* Tell the browser one of our windows has received the focus. This
1132 should always be done before merging menus (OnActivate merges the
1133 menus) if one of our windows has the focus.*/
1135 IShellBrowser_OnViewWindowActive(This->pShellBrowser,(IShellView*) This);
1136 ShellView_OnActivate(This, SVUIA_ACTIVATE_FOCUS);
1138 /* Set the focus to the listview */
1139 SetFocus(This->hWndList);
1141 /* Notify the ICommDlgBrowser interface */
1142 OnStateChange(This,CDBOSC_SETFOCUS);
1147 /**********************************************************
1148 * ShellView_OnKillFocus()
1150 static LRESULT ShellView_OnKillFocus(IShellViewImpl * This)
1152 TRACE("(%p) stub\n",This);
1154 ShellView_OnActivate(This, SVUIA_ACTIVATE_NOFOCUS);
1155 /* Notify the ICommDlgBrowser */
1156 OnStateChange(This,CDBOSC_KILLFOCUS);
1161 /**********************************************************
1162 * ShellView_OnCommand()
1165 * the CmdID's are the ones from the context menu
1167 static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd)
1169 TRACE("(%p)->(0x%08lx 0x%08lx %p) stub\n",This, dwCmdID, dwCmd, hwndCmd);
1173 case FCIDM_SHVIEW_SMALLICON:
1174 This->FolderSettings.ViewMode = FVM_SMALLICON;
1175 SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK);
1179 case FCIDM_SHVIEW_BIGICON:
1180 This->FolderSettings.ViewMode = FVM_ICON;
1181 SetStyle (This, LVS_ICON, LVS_TYPEMASK);
1185 case FCIDM_SHVIEW_LISTVIEW:
1186 This->FolderSettings.ViewMode = FVM_LIST;
1187 SetStyle (This, LVS_LIST, LVS_TYPEMASK);
1191 case FCIDM_SHVIEW_REPORTVIEW:
1192 This->FolderSettings.ViewMode = FVM_DETAILS;
1193 SetStyle (This, LVS_REPORT, LVS_TYPEMASK);
1197 /* the menu-ID's for sorting are 0x30... see shrec.rc */
1202 This->ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30);
1203 This->ListViewSortInfo.bIsAscending = TRUE;
1204 This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
1205 ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
1209 TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID);
1214 /**********************************************************
1215 * ShellView_OnNotify()
1218 static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpnmh)
1219 { LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)lpnmh;
1220 NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh;
1223 TRACE("%p CtlID=%u lpnmh->code=%x\n",This,CtlID,lpnmh->code);
1228 TRACE("-- NM_SETFOCUS %p\n",This);
1229 ShellView_OnSetFocus(This);
1233 TRACE("-- NM_KILLFOCUS %p\n",This);
1234 ShellView_OnDeactivate(This);
1235 /* Notify the ICommDlgBrowser interface */
1236 OnStateChange(This,CDBOSC_KILLFOCUS);
1240 TRACE("-- NM_CUSTOMDRAW %p\n",This);
1241 return CDRF_DODEFAULT;
1243 case NM_RELEASEDCAPTURE:
1244 TRACE("-- NM_RELEASEDCAPTURE %p\n",This);
1248 TRACE("-- NM_CLICK %p\n",This);
1252 TRACE("-- NM_RCLICK %p\n",This);
1256 TRACE("-- HDN_ENDTRACKA %p\n",This);
1257 /*nColumn1 = ListView_GetColumnWidth(This->hWndList, 0);
1258 nColumn2 = ListView_GetColumnWidth(This->hWndList, 1);*/
1261 case LVN_DELETEITEM:
1262 TRACE("-- LVN_DELETEITEM %p\n",This);
1263 SHFree((LPITEMIDLIST)lpnmlv->lParam); /*delete the pidl because we made a copy of it*/
1266 case LVN_DELETEALLITEMS:
1267 TRACE("-- LVN_DELETEALLITEMS %p\n",This);
1270 case LVN_INSERTITEM:
1271 TRACE("-- LVN_INSERTITEM (STUB)%p\n",This);
1274 case LVN_ITEMACTIVATE:
1275 TRACE("-- LVN_ITEMACTIVATE %p\n",This);
1276 OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */
1277 ShellView_DoContextMenu(This, 0, 0, TRUE);
1280 case LVN_COLUMNCLICK:
1281 This->ListViewSortInfo.nHeaderID = lpnmlv->iSubItem;
1282 if(This->ListViewSortInfo.nLastHeaderID == This->ListViewSortInfo.nHeaderID)
1284 This->ListViewSortInfo.bIsAscending = !This->ListViewSortInfo.bIsAscending;
1288 This->ListViewSortInfo.bIsAscending = TRUE;
1290 This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
1292 ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
1295 case LVN_GETDISPINFOA:
1296 case LVN_GETDISPINFOW:
1297 TRACE("-- LVN_GETDISPINFO %p\n",This);
1298 pidl = (LPITEMIDLIST)lpdi->item.lParam;
1300 if(lpdi->item.mask & LVIF_TEXT) /* text requested */
1302 if (This->pSF2Parent)
1305 IShellFolder2_GetDetailsOf(This->pSF2Parent, pidl, lpdi->item.iSubItem, &sd);
1306 if (lpnmh->code == LVN_GETDISPINFOA)
1308 StrRetToStrNA( lpdi->item.pszText, lpdi->item.cchTextMax, &sd.str, NULL);
1309 TRACE("-- text=%s\n",lpdi->item.pszText);
1311 else /* LVN_GETDISPINFOW */
1313 StrRetToStrNW( ((NMLVDISPINFOW *)lpdi)->item.pszText, lpdi->item.cchTextMax, &sd.str, NULL);
1314 TRACE("-- text=%s\n",debugstr_w((WCHAR*)(lpdi->item.pszText)));
1322 if(lpdi->item.mask & LVIF_IMAGE) /* image requested */
1324 lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0);
1328 case LVN_ITEMCHANGED:
1329 TRACE("-- LVN_ITEMCHANGED %p\n",This);
1330 OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */
1334 case LVN_BEGINRDRAG:
1335 TRACE("-- LVN_BEGINDRAG\n");
1337 if (ShellView_GetSelections(This))
1340 DWORD dwAttributes = SFGAO_CANLINK;
1341 DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
1343 if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, &IID_IDataObject,0,(LPVOID *)&pda)))
1345 IDropSource * pds = (IDropSource*)&(This->lpvtblDropSource); /* own DropSource interface */
1347 if (SUCCEEDED(IShellFolder_GetAttributesOf(This->pSFParent, This->cidl, (LPCITEMIDLIST*)This->apidl, &dwAttributes)))
1349 if (dwAttributes & SFGAO_CANLINK)
1351 dwEffect |= DROPEFFECT_LINK;
1358 DoDragDrop(pda, pds, dwEffect, &dwEffect);
1360 IDataObject_Release(pda);
1365 case LVN_BEGINLABELEDITA:
1367 DWORD dwAttr = SFGAO_CANRENAME;
1368 pidl = (LPITEMIDLIST)lpdi->item.lParam;
1370 TRACE("-- LVN_BEGINLABELEDITA %p\n",This);
1372 IShellFolder_GetAttributesOf(This->pSFParent, 1, (LPCITEMIDLIST*)&pidl, &dwAttr);
1373 if (SFGAO_CANRENAME & dwAttr)
1381 case LVN_ENDLABELEDITA:
1383 TRACE("-- LVN_ENDLABELEDITA %p\n",This);
1384 if (lpdi->item.pszText)
1387 WCHAR wszNewName[MAX_PATH];
1390 ZeroMemory(&lvItem, sizeof(LVITEMA));
1391 lvItem.iItem = lpdi->item.iItem;
1392 lvItem.mask = LVIF_PARAM;
1393 ListView_GetItemA(This->hWndList, &lvItem);
1395 pidl = (LPITEMIDLIST)lpdi->item.lParam;
1396 if (!MultiByteToWideChar( CP_ACP, 0, lpdi->item.pszText, -1, wszNewName, MAX_PATH ))
1397 wszNewName[MAX_PATH-1] = 0;
1398 hr = IShellFolder_SetNameOf(This->pSFParent, 0, pidl, wszNewName, SHGDN_INFOLDER, &pidl);
1400 if(SUCCEEDED(hr) && pidl)
1402 lvItem.mask = LVIF_PARAM;
1403 lvItem.lParam = (LPARAM)pidl;
1404 ListView_SetItemA(This->hWndList, &lvItem);
1415 msg.hwnd = This->hWnd;
1416 msg.message = WM_KEYDOWN;
1417 msg.wParam = plvKeyDown->wVKey;
1422 LPNMLVKEYDOWN plvKeyDown = (LPNMLVKEYDOWN) lpnmh;
1424 /* initiate a rename of the selected file or directory */
1425 if(plvKeyDown->wVKey == VK_F2)
1427 /* see how many files are selected */
1428 int i = ListView_GetSelectedCount(This->hWndList);
1430 /* get selected item */
1433 /* get selected item */
1434 i = ListView_GetNextItem(This->hWndList, -1,
1437 ListView_EnsureVisible(This->hWndList, i, 0);
1438 ListView_EditLabelA(This->hWndList, i);
1442 TranslateAccelerator(This->hWnd, This->hAccel, &msg)
1444 else if(plvKeyDown->wVKey == VK_DELETE)
1449 LPITEMIDLIST* pItems;
1452 IShellFolder_QueryInterface(This->pSFParent, &IID_ISFHelper,
1455 if(!(i = ListView_GetSelectedCount(This->hWndList)))
1458 /* allocate memory for the pidl array */
1459 pItems = HeapAlloc(GetProcessHeap(), 0,
1460 sizeof(LPITEMIDLIST) * i);
1462 /* retrieve all selected items */
1465 while(ListView_GetSelectedCount(This->hWndList) > i)
1467 /* get selected item */
1468 item_index = ListView_GetNextItem(This->hWndList,
1469 item_index, LVNI_SELECTED);
1470 item.iItem = item_index;
1471 item.mask |= LVIF_PARAM;
1472 ListView_GetItemA(This->hWndList, &item);
1475 pItems[i] = (LPITEMIDLIST)item.lParam;
1480 /* perform the item deletion */
1481 ISFHelper_DeleteItems(psfhlp, i, (LPCITEMIDLIST*)pItems);
1483 /* free pidl array memory */
1484 HeapFree(GetProcessHeap(), 0, pItems);
1487 FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown->wVKey);
1492 TRACE("-- %p WM_COMMAND %x unhandled\n", This, lpnmh->code);
1498 /**********************************************************
1499 * ShellView_OnChange()
1502 static LRESULT ShellView_OnChange(IShellViewImpl * This, LPITEMIDLIST * Pidls, LONG wEventId)
1505 TRACE("(%p)(%p,%p,0x%08lx)\n", This, Pidls[0], Pidls[1], wEventId);
1510 LV_AddItem(This, Pidls[0]);
1514 LV_DeleteItem(This, Pidls[0]);
1516 case SHCNE_RENAMEFOLDER:
1517 case SHCNE_RENAMEITEM:
1518 LV_RenameItem(This, Pidls[0], Pidls[1]);
1520 case SHCNE_UPDATEITEM:
1525 /**********************************************************
1529 static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
1531 IShellViewImpl * pThis = (IShellViewImpl*)GetWindowLongA(hWnd, GWL_USERDATA);
1532 LPCREATESTRUCTA lpcs;
1534 TRACE("(hwnd=%p msg=%x wparm=%x lparm=%lx)\n",hWnd, uMessage, wParam, lParam);
1539 lpcs = (LPCREATESTRUCTA)lParam;
1540 pThis = (IShellViewImpl*)(lpcs->lpCreateParams);
1541 SetWindowLongA(hWnd, GWL_USERDATA, (LONG)pThis);
1542 pThis->hWnd = hWnd; /*set the window handle*/
1545 case WM_SIZE: return ShellView_OnSize(pThis,LOWORD(lParam), HIWORD(lParam));
1546 case WM_SETFOCUS: return ShellView_OnSetFocus(pThis);
1547 case WM_KILLFOCUS: return ShellView_OnKillFocus(pThis);
1548 case WM_CREATE: return ShellView_OnCreate(pThis);
1549 case WM_ACTIVATE: return ShellView_OnActivate(pThis, SVUIA_ACTIVATE_FOCUS);
1550 case WM_NOTIFY: return ShellView_OnNotify(pThis,(UINT)wParam, (LPNMHDR)lParam);
1551 case WM_COMMAND: return ShellView_OnCommand(pThis,
1552 GET_WM_COMMAND_ID(wParam, lParam),
1553 GET_WM_COMMAND_CMD(wParam, lParam),
1554 GET_WM_COMMAND_HWND(wParam, lParam));
1555 case SHV_CHANGE_NOTIFY: return ShellView_OnChange(pThis, (LPITEMIDLIST*)wParam, (LONG)lParam);
1557 case WM_CONTEXTMENU: ShellView_DoContextMenu(pThis, LOWORD(lParam), HIWORD(lParam), FALSE);
1560 case WM_SHOWWINDOW: UpdateWindow(pThis->hWndList);
1563 case WM_GETDLGCODE: return SendMessageA(pThis->hWndList,uMessage,0,0);
1566 RevokeDragDrop(pThis->hWnd);
1567 SHChangeNotifyDeregister(pThis->hNotify);
1571 if ((pThis->FolderSettings.fFlags & FWF_DESKTOP) ||
1572 (pThis->FolderSettings.fFlags & FWF_TRANSPARENT))
1577 return DefWindowProcA (hWnd, uMessage, wParam, lParam);
1579 /**********************************************************
1582 * The INTERFACE of the IShellView object
1585 **********************************************************
1586 * IShellView_QueryInterface
1588 static HRESULT WINAPI IShellView_fnQueryInterface(IShellView * iface,REFIID riid, LPVOID *ppvObj)
1590 ICOM_THIS(IShellViewImpl, iface);
1592 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
1596 if(IsEqualIID(riid, &IID_IUnknown))
1600 else if(IsEqualIID(riid, &IID_IShellView))
1602 *ppvObj = (IShellView*)This;
1604 else if(IsEqualIID(riid, &IID_IOleCommandTarget))
1606 *ppvObj = (IOleCommandTarget*)&(This->lpvtblOleCommandTarget);
1608 else if(IsEqualIID(riid, &IID_IDropTarget))
1610 *ppvObj = (IDropTarget*)&(This->lpvtblDropTarget);
1612 else if(IsEqualIID(riid, &IID_IDropSource))
1614 *ppvObj = (IDropSource*)&(This->lpvtblDropSource);
1616 else if(IsEqualIID(riid, &IID_IViewObject))
1618 *ppvObj = (IViewObject*)&(This->lpvtblViewObject);
1623 IUnknown_AddRef( (IUnknown*)*ppvObj );
1624 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
1627 TRACE("-- Interface: E_NOINTERFACE\n");
1628 return E_NOINTERFACE;
1631 /**********************************************************
1634 static ULONG WINAPI IShellView_fnAddRef(IShellView * iface)
1636 ICOM_THIS(IShellViewImpl, iface);
1638 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1640 return ++(This->ref);
1642 /**********************************************************
1643 * IShellView_Release
1645 static ULONG WINAPI IShellView_fnRelease(IShellView * iface)
1647 ICOM_THIS(IShellViewImpl, iface);
1649 TRACE("(%p)->()\n",This);
1653 TRACE(" destroying IShellView(%p)\n",This);
1655 DestroyWindow(This->hWndList);
1658 IShellFolder_Release(This->pSFParent);
1660 if(This->pSF2Parent)
1661 IShellFolder2_Release(This->pSF2Parent);
1664 SHFree(This->apidl);
1666 HeapFree(GetProcessHeap(),0,This);
1672 /**********************************************************
1673 * ShellView_GetWindow
1675 static HRESULT WINAPI IShellView_fnGetWindow(IShellView * iface,HWND * phWnd)
1677 ICOM_THIS(IShellViewImpl, iface);
1679 TRACE("(%p)\n",This);
1681 *phWnd = This->hWnd;
1686 static HRESULT WINAPI IShellView_fnContextSensitiveHelp(IShellView * iface,BOOL fEnterMode)
1688 ICOM_THIS(IShellViewImpl, iface);
1690 FIXME("(%p) stub\n",This);
1695 /**********************************************************
1696 * IShellView_TranslateAccelerator
1699 * use the accel functions
1701 static HRESULT WINAPI IShellView_fnTranslateAccelerator(IShellView * iface,LPMSG lpmsg)
1704 ICOM_THIS(IShellViewImpl, iface);
1706 FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam);
1709 if ((lpmsg->message>=WM_KEYFIRST) && (lpmsg->message>=WM_KEYLAST))
1711 TRACE("-- key=0x04%x\n",lpmsg->wParam) ;
1713 return S_FALSE; /* not handled */
1716 static HRESULT WINAPI IShellView_fnEnableModeless(IShellView * iface,BOOL fEnable)
1718 ICOM_THIS(IShellViewImpl, iface);
1720 FIXME("(%p) stub\n",This);
1725 static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState)
1727 ICOM_THIS(IShellViewImpl, iface);
1730 CHAR szName[MAX_PATH];
1733 int nPartArray[1] = {-1};
1735 TRACE("(%p)->(state=%x) stub\n",This, uState);
1737 /*don't do anything if the state isn't really changing*/
1738 if(This->uState == uState)
1743 /*OnActivate handles the menu merging and internal state*/
1744 ShellView_OnActivate(This, uState);
1746 /*only do This if we are active*/
1747 if(uState != SVUIA_DEACTIVATE)
1751 GetFolderPath is not a method of IShellFolder
1752 IShellFolder_GetFolderPath( This->pSFParent, szName, sizeof(szName) );
1754 /* set the number of parts */
1755 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETPARTS, 1,
1756 (LPARAM)nPartArray, &lResult);
1758 /* set the text for the parts */
1760 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA,
1761 0, (LPARAM)szName, &lResult);
1768 static HRESULT WINAPI IShellView_fnRefresh(IShellView * iface)
1770 ICOM_THIS(IShellViewImpl, iface);
1772 TRACE("(%p)\n",This);
1774 ListView_DeleteAllItems(This->hWndList);
1775 ShellView_FillList(This);
1780 static HRESULT WINAPI IShellView_fnCreateViewWindow(
1782 IShellView *lpPrevView,
1783 LPCFOLDERSETTINGS lpfs,
1784 IShellBrowser * psb,
1788 ICOM_THIS(IShellViewImpl, iface);
1794 TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd);
1795 TRACE("-- vmode=%x flags=%x left=%li top=%li right=%li bottom=%li\n",lpfs->ViewMode, lpfs->fFlags ,prcView->left,prcView->top, prcView->right, prcView->bottom);
1797 /*set up the member variables*/
1798 This->pShellBrowser = psb;
1799 This->FolderSettings = *lpfs;
1801 /*get our parent window*/
1802 IShellBrowser_AddRef(This->pShellBrowser);
1803 IShellBrowser_GetWindow(This->pShellBrowser, &(This->hWndParent));
1805 /* try to get the ICommDlgBrowserInterface, adds a reference !!! */
1806 This->pCommDlgBrowser=NULL;
1807 if ( SUCCEEDED (IShellBrowser_QueryInterface( This->pShellBrowser,
1808 (REFIID)&IID_ICommDlgBrowser, (LPVOID*) &This->pCommDlgBrowser)))
1810 TRACE("-- CommDlgBrowser\n");
1813 /*if our window class has not been registered, then do so*/
1814 if(!GetClassInfoA(shell32_hInstance, SV_CLASS_NAME, &wc))
1816 ZeroMemory(&wc, sizeof(wc));
1817 wc.style = CS_HREDRAW | CS_VREDRAW;
1818 wc.lpfnWndProc = (WNDPROC) ShellView_WndProc;
1821 wc.hInstance = shell32_hInstance;
1823 wc.hCursor = LoadCursorA (0, (LPSTR)IDC_ARROW);
1824 wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
1825 wc.lpszMenuName = NULL;
1826 wc.lpszClassName = SV_CLASS_NAME;
1828 if(!RegisterClassA(&wc))
1832 *phWnd = CreateWindowExA(0,
1835 WS_CHILD | WS_VISIBLE | WS_TABSTOP,
1838 prcView->right - prcView->left,
1839 prcView->bottom - prcView->top,
1847 if(!*phWnd) return E_FAIL;
1852 static HRESULT WINAPI IShellView_fnDestroyViewWindow(IShellView * iface)
1854 ICOM_THIS(IShellViewImpl, iface);
1856 TRACE("(%p)\n",This);
1858 /*Make absolutely sure all our UI is cleaned up.*/
1859 IShellView_UIActivate((IShellView*)This, SVUIA_DEACTIVATE);
1863 DestroyMenu(This->hMenu);
1866 DestroyWindow(This->hWnd);
1867 if(This->pShellBrowser) IShellBrowser_Release(This->pShellBrowser);
1868 if(This->pCommDlgBrowser) ICommDlgBrowser_Release(This->pCommDlgBrowser);
1874 static HRESULT WINAPI IShellView_fnGetCurrentInfo(IShellView * iface, LPFOLDERSETTINGS lpfs)
1876 ICOM_THIS(IShellViewImpl, iface);
1878 TRACE("(%p)->(%p) vmode=%x flags=%x\n",This, lpfs,
1879 This->FolderSettings.ViewMode, This->FolderSettings.fFlags);
1881 if (!lpfs) return E_INVALIDARG;
1883 *lpfs = This->FolderSettings;
1887 static HRESULT WINAPI IShellView_fnAddPropertySheetPages(IShellView * iface, DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam)
1889 ICOM_THIS(IShellViewImpl, iface);
1891 FIXME("(%p) stub\n",This);
1896 static HRESULT WINAPI IShellView_fnSaveViewState(IShellView * iface)
1898 ICOM_THIS(IShellViewImpl, iface);
1900 FIXME("(%p) stub\n",This);
1905 static HRESULT WINAPI IShellView_fnSelectItem(
1910 ICOM_THIS(IShellViewImpl, iface);
1913 TRACE("(%p)->(pidl=%p, 0x%08x) stub\n",This, pidl, uFlags);
1915 i = LV_FindItemByPidl(This, pidl);
1921 if(uFlags & SVSI_ENSUREVISIBLE)
1922 ListView_EnsureVisible(This->hWndList, i, 0);
1924 ZeroMemory(&lvItem, sizeof(LVITEMA));
1925 lvItem.mask = LVIF_STATE;
1928 while(ListView_GetItemA(This->hWndList, &lvItem))
1930 if (lvItem.iItem == i)
1932 if (uFlags & SVSI_SELECT)
1933 lvItem.state |= LVIS_SELECTED;
1935 lvItem.state &= ~LVIS_SELECTED;
1937 if(uFlags & SVSI_FOCUSED)
1938 lvItem.state &= ~LVIS_FOCUSED;
1942 if (uFlags & SVSI_DESELECTOTHERS)
1943 lvItem.state &= ~LVIS_SELECTED;
1945 ListView_SetItemA(This->hWndList, &lvItem);
1950 if(uFlags & SVSI_EDIT)
1951 ListView_EditLabelA(This->hWndList, i);
1957 static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, REFIID riid, LPVOID *ppvOut)
1959 ICOM_THIS(IShellViewImpl, iface);
1961 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This, uItem, debugstr_guid(riid), ppvOut);
1967 case SVGIO_BACKGROUND:
1968 *ppvOut = ISvBgCm_Constructor(This->pSFParent);
1971 case SVGIO_SELECTION:
1972 ShellView_GetSelections(This);
1973 IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, (LPCITEMIDLIST*)This->apidl, riid, 0, ppvOut);
1976 TRACE("-- (%p)->(interface=%p)\n",This, *ppvOut);
1978 if(!*ppvOut) return E_OUTOFMEMORY;
1983 static struct ICOM_VTABLE(IShellView) svvt =
1985 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1986 IShellView_fnQueryInterface,
1987 IShellView_fnAddRef,
1988 IShellView_fnRelease,
1989 IShellView_fnGetWindow,
1990 IShellView_fnContextSensitiveHelp,
1991 IShellView_fnTranslateAccelerator,
1992 IShellView_fnEnableModeless,
1993 IShellView_fnUIActivate,
1994 IShellView_fnRefresh,
1995 IShellView_fnCreateViewWindow,
1996 IShellView_fnDestroyViewWindow,
1997 IShellView_fnGetCurrentInfo,
1998 IShellView_fnAddPropertySheetPages,
1999 IShellView_fnSaveViewState,
2000 IShellView_fnSelectItem,
2001 IShellView_fnGetItemObject
2005 /**********************************************************
2006 * ISVOleCmdTarget_QueryInterface (IUnknown)
2008 static HRESULT WINAPI ISVOleCmdTarget_QueryInterface(
2009 IOleCommandTarget * iface,
2013 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
2015 return IShellFolder_QueryInterface((IShellFolder*)This, iid, ppvObj);
2018 /**********************************************************
2019 * ISVOleCmdTarget_AddRef (IUnknown)
2021 static ULONG WINAPI ISVOleCmdTarget_AddRef(
2022 IOleCommandTarget * iface)
2024 _ICOM_THIS_From_IOleCommandTarget(IShellFolder, iface);
2026 return IShellFolder_AddRef((IShellFolder*)This);
2029 /**********************************************************
2030 * ISVOleCmdTarget_Release (IUnknown)
2032 static ULONG WINAPI ISVOleCmdTarget_Release(
2033 IOleCommandTarget * iface)
2035 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
2037 return IShellFolder_Release((IShellFolder*)This);
2040 /**********************************************************
2041 * ISVOleCmdTarget_QueryStatus (IOleCommandTarget)
2043 static HRESULT WINAPI ISVOleCmdTarget_QueryStatus(
2044 IOleCommandTarget *iface,
2045 const GUID* pguidCmdGroup,
2048 OLECMDTEXT* pCmdText)
2051 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
2053 FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n",
2054 This, pguidCmdGroup, debugstr_guid(pguidCmdGroup), cCmds, prgCmds, pCmdText);
2058 for (i = 0; i < cCmds; i++)
2060 FIXME("\tprgCmds[%d].cmdID = %ld\n", i, prgCmds[i].cmdID);
2061 prgCmds[i].cmdf = 0;
2063 return OLECMDERR_E_UNKNOWNGROUP;
2066 /**********************************************************
2067 * ISVOleCmdTarget_Exec (IOleCommandTarget)
2069 * nCmdID is the OLECMDID_* enumeration
2071 static HRESULT WINAPI ISVOleCmdTarget_Exec(
2072 IOleCommandTarget *iface,
2073 const GUID* pguidCmdGroup,
2079 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
2081 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n",
2082 This, debugstr_guid(pguidCmdGroup), nCmdID, nCmdexecopt, pvaIn, pvaOut);
2084 if (IsEqualIID(pguidCmdGroup, &CGID_Explorer) &&
2086 (nCmdexecopt == 4) && pvaOut)
2088 if (IsEqualIID(pguidCmdGroup, &CGID_ShellDocView) &&
2093 return OLECMDERR_E_UNKNOWNGROUP;
2096 static ICOM_VTABLE(IOleCommandTarget) ctvt =
2098 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2099 ISVOleCmdTarget_QueryInterface,
2100 ISVOleCmdTarget_AddRef,
2101 ISVOleCmdTarget_Release,
2102 ISVOleCmdTarget_QueryStatus,
2103 ISVOleCmdTarget_Exec
2106 /**********************************************************
2107 * ISVDropTarget implementation
2110 static HRESULT WINAPI ISVDropTarget_QueryInterface(
2115 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2117 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
2119 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
2122 static ULONG WINAPI ISVDropTarget_AddRef( IDropTarget *iface)
2124 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2126 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2128 return IShellFolder_AddRef((IShellFolder*)This);
2131 static ULONG WINAPI ISVDropTarget_Release( IDropTarget *iface)
2133 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2135 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2137 return IShellFolder_Release((IShellFolder*)This);
2140 static HRESULT WINAPI ISVDropTarget_DragEnter(
2142 IDataObject *pDataObject,
2148 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2150 FIXME("Stub: This=%p, DataObject=%p\n",This,pDataObject);
2155 static HRESULT WINAPI ISVDropTarget_DragOver(
2161 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2163 FIXME("Stub: This=%p\n",This);
2168 static HRESULT WINAPI ISVDropTarget_DragLeave(
2171 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2173 FIXME("Stub: This=%p\n",This);
2178 static HRESULT WINAPI ISVDropTarget_Drop(
2180 IDataObject* pDataObject,
2185 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
2187 FIXME("Stub: This=%p\n",This);
2192 static struct ICOM_VTABLE(IDropTarget) dtvt =
2194 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2195 ISVDropTarget_QueryInterface,
2196 ISVDropTarget_AddRef,
2197 ISVDropTarget_Release,
2198 ISVDropTarget_DragEnter,
2199 ISVDropTarget_DragOver,
2200 ISVDropTarget_DragLeave,
2204 /**********************************************************
2205 * ISVDropSource implementation
2208 static HRESULT WINAPI ISVDropSource_QueryInterface(
2213 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
2215 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
2217 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
2220 static ULONG WINAPI ISVDropSource_AddRef( IDropSource *iface)
2222 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
2224 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2226 return IShellFolder_AddRef((IShellFolder*)This);
2229 static ULONG WINAPI ISVDropSource_Release( IDropSource *iface)
2231 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
2233 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2235 return IShellFolder_Release((IShellFolder*)This);
2237 static HRESULT WINAPI ISVDropSource_QueryContinueDrag(
2239 BOOL fEscapePressed,
2242 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
2243 TRACE("(%p)\n",This);
2246 return DRAGDROP_S_CANCEL;
2247 else if (!(grfKeyState & MK_LBUTTON) && !(grfKeyState & MK_RBUTTON))
2248 return DRAGDROP_S_DROP;
2253 static HRESULT WINAPI ISVDropSource_GiveFeedback(
2257 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
2258 TRACE("(%p)\n",This);
2260 return DRAGDROP_S_USEDEFAULTCURSORS;
2263 static struct ICOM_VTABLE(IDropSource) dsvt =
2265 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2266 ISVDropSource_QueryInterface,
2267 ISVDropSource_AddRef,
2268 ISVDropSource_Release,
2269 ISVDropSource_QueryContinueDrag,
2270 ISVDropSource_GiveFeedback
2272 /**********************************************************
2273 * ISVViewObject implementation
2276 static HRESULT WINAPI ISVViewObject_QueryInterface(
2281 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2283 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,debugstr_guid(riid),ppvObj);
2285 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
2288 static ULONG WINAPI ISVViewObject_AddRef( IViewObject *iface)
2290 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2292 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2294 return IShellFolder_AddRef((IShellFolder*)This);
2297 static ULONG WINAPI ISVViewObject_Release( IViewObject *iface)
2299 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2301 TRACE("(%p)->(count=%lu)\n",This,This->ref);
2303 return IShellFolder_Release((IShellFolder*)This);
2306 static HRESULT WINAPI ISVViewObject_Draw(
2311 DVTARGETDEVICE* ptd,
2314 LPCRECTL lprcBounds,
2315 LPCRECTL lprcWBounds,
2316 BOOL (CALLBACK *pfnContinue)(ULONG_PTR dwContinue),
2320 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2322 FIXME("Stub: This=%p\n",This);
2326 static HRESULT WINAPI ISVViewObject_GetColorSet(
2331 DVTARGETDEVICE* ptd,
2332 HDC hicTargetDevice,
2333 LOGPALETTE** ppColorSet)
2336 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2338 FIXME("Stub: This=%p\n",This);
2342 static HRESULT WINAPI ISVViewObject_Freeze(
2350 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2352 FIXME("Stub: This=%p\n",This);
2356 static HRESULT WINAPI ISVViewObject_Unfreeze(
2361 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2363 FIXME("Stub: This=%p\n",This);
2367 static HRESULT WINAPI ISVViewObject_SetAdvise(
2371 IAdviseSink* pAdvSink)
2374 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2376 FIXME("Stub: This=%p\n",This);
2380 static HRESULT WINAPI ISVViewObject_GetAdvise(
2384 IAdviseSink** ppAdvSink)
2387 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
2389 FIXME("Stub: This=%p\n",This);
2395 static struct ICOM_VTABLE(IViewObject) vovt =
2397 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2398 ISVViewObject_QueryInterface,
2399 ISVViewObject_AddRef,
2400 ISVViewObject_Release,
2402 ISVViewObject_GetColorSet,
2403 ISVViewObject_Freeze,
2404 ISVViewObject_Unfreeze,
2405 ISVViewObject_SetAdvise,
2406 ISVViewObject_GetAdvise