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
48 #include "undocshell.h"
50 #include "wine/debug.h"
54 #include "shell32_main.h"
55 #include "shellfolder.h"
57 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
63 }LISTVIEW_SORT_INFO
, *LPLISTVIEW_SORT_INFO
;
66 { ICOM_VFIELD(IShellView
);
68 ICOM_VTABLE(IOleCommandTarget
)* lpvtblOleCommandTarget
;
69 ICOM_VTABLE(IDropTarget
)* lpvtblDropTarget
;
70 ICOM_VTABLE(IDropSource
)* lpvtblDropSource
;
71 ICOM_VTABLE(IViewObject
)* lpvtblViewObject
;
72 IShellFolder
* pSFParent
;
73 IShellFolder2
* pSF2Parent
;
74 IShellBrowser
* pShellBrowser
;
75 ICommDlgBrowser
* pCommDlgBrowser
;
76 HWND hWnd
; /* SHELLDLL_DefView */
77 HWND hWndList
; /* ListView control */
79 FOLDERSETTINGS FolderSettings
;
84 LISTVIEW_SORT_INFO ListViewSortInfo
;
85 HANDLE hNotify
; /* change notification handle */
89 static struct ICOM_VTABLE(IShellView
) svvt
;
91 static struct ICOM_VTABLE(IOleCommandTarget
) ctvt
;
92 #define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget)))
93 #define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset);
95 static struct ICOM_VTABLE(IDropTarget
) dtvt
;
96 #define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget)))
97 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
99 static struct ICOM_VTABLE(IDropSource
) dsvt
;
100 #define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource)))
101 #define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset);
103 static struct ICOM_VTABLE(IViewObject
) vovt
;
104 #define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject)))
105 #define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset);
107 /* ListView Header ID's */
108 #define LISTVIEW_COLUMN_NAME 0
109 #define LISTVIEW_COLUMN_SIZE 1
110 #define LISTVIEW_COLUMN_TYPE 2
111 #define LISTVIEW_COLUMN_TIME 3
112 #define LISTVIEW_COLUMN_ATTRIB 4
115 #define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
116 #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
117 #define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
119 #define ID_LISTVIEW 2000
121 #define SHV_CHANGE_NOTIFY WM_USER + 0x1111
124 #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
125 #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
126 #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
128 extern void WINAPI
_InsertMenuItem (HMENU hmenu
, UINT indexMenu
, BOOL fByPosition
,
129 UINT wID
, UINT fType
, LPSTR dwTypeData
, UINT fState
);
132 Items merged into the toolbar and and the filemenu
141 } MYTOOLINFO
, *LPMYTOOLINFO
;
145 { FCIDM_SHVIEW_BIGICON
, 0, 0, IDS_VIEW_LARGE
, TBSTATE_ENABLED
, TBSTYLE_BUTTON
},
146 { FCIDM_SHVIEW_SMALLICON
, 0, 0, IDS_VIEW_SMALL
, TBSTATE_ENABLED
, TBSTYLE_BUTTON
},
147 { FCIDM_SHVIEW_LISTVIEW
, 0, 0, IDS_VIEW_LIST
, TBSTATE_ENABLED
, TBSTYLE_BUTTON
},
148 { FCIDM_SHVIEW_REPORTVIEW
, 0, 0, IDS_VIEW_DETAILS
, TBSTATE_ENABLED
, TBSTYLE_BUTTON
},
152 typedef void (CALLBACK
*PFNSHGETSETTINGSPROC
)(LPSHELLFLAGSTATE lpsfs
, DWORD dwMask
);
154 /**********************************************************
155 * IShellView_Constructor
157 IShellView
* IShellView_Constructor( IShellFolder
* pFolder
)
158 { IShellViewImpl
* sv
;
159 sv
=(IShellViewImpl
*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IShellViewImpl
));
162 sv
->lpvtblOleCommandTarget
=&ctvt
;
163 sv
->lpvtblDropTarget
=&dtvt
;
164 sv
->lpvtblDropSource
=&dsvt
;
165 sv
->lpvtblViewObject
=&vovt
;
167 sv
->pSFParent
= pFolder
;
168 if(pFolder
) IShellFolder_AddRef(pFolder
);
169 IShellFolder_QueryInterface(sv
->pSFParent
, &IID_IShellFolder2
, (LPVOID
*)&sv
->pSF2Parent
);
171 TRACE("(%p)->(%p)\n",sv
, pFolder
);
173 return (IShellView
*) sv
;
176 /**********************************************************
178 * ##### helperfunctions for communication with ICommDlgBrowser #####
180 static BOOL
IsInCommDlg(IShellViewImpl
* This
)
181 { return(This
->pCommDlgBrowser
!= NULL
);
184 static HRESULT
IncludeObject(IShellViewImpl
* This
, LPCITEMIDLIST pidl
)
188 if ( IsInCommDlg(This
) )
190 TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl
);
191 ret
= ICommDlgBrowser_IncludeObject(This
->pCommDlgBrowser
, (IShellView
*)This
, pidl
);
192 TRACE("--0x%08lx\n", ret
);
197 static HRESULT
OnDefaultCommand(IShellViewImpl
* This
)
199 HRESULT ret
= S_FALSE
;
201 if (IsInCommDlg(This
))
203 TRACE("ICommDlgBrowser::OnDefaultCommand\n");
204 ret
= ICommDlgBrowser_OnDefaultCommand(This
->pCommDlgBrowser
, (IShellView
*)This
);
210 static HRESULT
OnStateChange(IShellViewImpl
* This
, UINT uFlags
)
212 HRESULT ret
= S_FALSE
;
214 if (IsInCommDlg(This
))
216 TRACE("ICommDlgBrowser::OnStateChange flags=%x\n", uFlags
);
217 ret
= ICommDlgBrowser_OnStateChange(This
->pCommDlgBrowser
, (IShellView
*)This
, uFlags
);
222 /**********************************************************
223 * set the toolbar of the filedialog buttons
225 * - activates the buttons from the shellbrowser according to
228 static void CheckToolbar(IShellViewImpl
* This
)
234 if (IsInCommDlg(This
))
236 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_CHECKBUTTON
,
237 FCIDM_TB_SMALLICON
, (This
->FolderSettings
.ViewMode
==FVM_LIST
)? TRUE
: FALSE
, &result
);
238 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_CHECKBUTTON
,
239 FCIDM_TB_REPORTVIEW
, (This
->FolderSettings
.ViewMode
==FVM_DETAILS
)? TRUE
: FALSE
, &result
);
240 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_ENABLEBUTTON
,
241 FCIDM_TB_SMALLICON
, TRUE
, &result
);
242 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_ENABLEBUTTON
,
243 FCIDM_TB_REPORTVIEW
, TRUE
, &result
);
247 /**********************************************************
249 * ##### helperfunctions for initializing the view #####
251 /**********************************************************
252 * change the style of the listview control
254 static void SetStyle(IShellViewImpl
* This
, DWORD dwAdd
, DWORD dwRemove
)
258 TRACE("(%p)\n", This
);
260 tmpstyle
= GetWindowLongA(This
->hWndList
, GWL_STYLE
);
261 SetWindowLongA(This
->hWndList
, GWL_STYLE
, dwAdd
| (tmpstyle
& ~dwRemove
));
264 /**********************************************************
265 * ShellView_CreateList()
267 * - creates the list view window
269 static BOOL
ShellView_CreateList (IShellViewImpl
* This
)
274 dwStyle
= WS_TABSTOP
| WS_VISIBLE
| WS_CHILDWINDOW
| WS_CLIPSIBLINGS
| WS_CLIPCHILDREN
|
275 LVS_SHAREIMAGELISTS
| LVS_EDITLABELS
| LVS_ALIGNLEFT
| LVS_AUTOARRANGE
;
277 switch (This
->FolderSettings
.ViewMode
)
279 case FVM_ICON
: dwStyle
|= LVS_ICON
; break;
280 case FVM_DETAILS
: dwStyle
|= LVS_REPORT
; break;
281 case FVM_SMALLICON
: dwStyle
|= LVS_SMALLICON
; break;
282 case FVM_LIST
: dwStyle
|= LVS_LIST
; break;
283 default: dwStyle
|= LVS_LIST
; break;
286 if (This
->FolderSettings
.fFlags
& FWF_AUTOARRANGE
) dwStyle
|= LVS_AUTOARRANGE
;
287 /*if (This->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/
288 if (This
->FolderSettings
.fFlags
& FWF_SINGLESEL
) dwStyle
|= LVS_SINGLESEL
;
290 This
->hWndList
=CreateWindowExA( WS_EX_CLIENTEDGE
,
303 This
->ListViewSortInfo
.bIsAscending
= TRUE
;
304 This
->ListViewSortInfo
.nHeaderID
= -1;
305 This
->ListViewSortInfo
.nLastHeaderID
= -1;
307 /* UpdateShellSettings(); */
311 /**********************************************************
312 * ShellView_InitList()
314 * - adds all needed columns to the shellview
316 static BOOL
ShellView_InitList(IShellViewImpl
* This
)
325 ListView_DeleteAllItems(This
->hWndList
);
327 lvColumn
.mask
= LVCF_FMT
| LVCF_WIDTH
| LVCF_TEXT
;
328 lvColumn
.pszText
= szTemp
;
330 if (This
->pSF2Parent
)
334 if (!SUCCEEDED(IShellFolder2_GetDetailsOf(This
->pSF2Parent
, NULL
, i
, &sd
)))
336 lvColumn
.fmt
= sd
.fmt
;
337 lvColumn
.cx
= sd
.cxChar
*8; /* chars->pixel */
338 StrRetToStrNA( szTemp
, 50, &sd
.str
, NULL
);
339 ListView_InsertColumnA(This
->hWndList
, i
, &lvColumn
);
347 ListView_SetImageList(This
->hWndList
, ShellSmallIconList
, LVSIL_SMALL
);
348 ListView_SetImageList(This
->hWndList
, ShellBigIconList
, LVSIL_NORMAL
);
352 /**********************************************************
353 * ShellView_CompareItems()
356 * internal, CALLBACK for DSA_Sort
358 static INT CALLBACK
ShellView_CompareItems(LPVOID lParam1
, LPVOID lParam2
, LPARAM lpData
)
361 TRACE("pidl1=%p pidl2=%p lpsf=%p\n", lParam1
, lParam2
, (LPVOID
) lpData
);
363 if(!lpData
) return 0;
365 ret
= (SHORT
) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER
)lpData
, 0, (LPITEMIDLIST
)lParam1
, (LPITEMIDLIST
)lParam2
));
366 TRACE("ret=%i\n",ret
);
370 /*************************************************************************
371 * ShellView_ListViewCompareItems
373 * Compare Function for the Listview (FileOpen Dialog)
376 * lParam1 [I] the first ItemIdList to compare with
377 * lParam2 [I] the second ItemIdList to compare with
378 * lpData [I] The column ID for the header Ctrl to process
381 * A negative value if the first item should precede the second,
382 * a positive value if the first item should follow the second,
383 * or zero if the two items are equivalent
386 * FIXME: function does what ShellView_CompareItems is supposed to do.
387 * unify it and figure out how to use the undocumented first parameter
388 * of IShellFolder_CompareIDs to do the job this function does and
389 * move this code to IShellFolder.
390 * make LISTVIEW_SORT_INFO obsolete
391 * the way this function works is only usable if we had only
392 * filesystemfolders (25/10/99 jsch)
394 static INT CALLBACK
ShellView_ListViewCompareItems(LPVOID lParam1
, LPVOID lParam2
, LPARAM lpData
)
398 char strName1
[MAX_PATH
], strName2
[MAX_PATH
];
399 BOOL bIsFolder1
, bIsFolder2
,bIsBothFolder
;
400 LPITEMIDLIST pItemIdList1
= (LPITEMIDLIST
) lParam1
;
401 LPITEMIDLIST pItemIdList2
= (LPITEMIDLIST
) lParam2
;
402 LISTVIEW_SORT_INFO
*pSortInfo
= (LPLISTVIEW_SORT_INFO
) lpData
;
405 bIsFolder1
= _ILIsFolder(pItemIdList1
);
406 bIsFolder2
= _ILIsFolder(pItemIdList2
);
407 bIsBothFolder
= bIsFolder1
&& bIsFolder2
;
409 /* When sorting between a File and a Folder, the Folder gets sorted first */
410 if( (bIsFolder1
|| bIsFolder2
) && !bIsBothFolder
)
412 nDiff
= bIsFolder1
? -1 : 1;
416 /* Sort by Time: Folders or Files can be sorted */
418 if(pSortInfo
->nHeaderID
== LISTVIEW_COLUMN_TIME
)
420 _ILGetFileDateTime(pItemIdList1
, &fd1
);
421 _ILGetFileDateTime(pItemIdList2
, &fd2
);
422 nDiff
= CompareFileTime(&fd2
, &fd1
);
424 /* Sort by Attribute: Folder or Files can be sorted */
425 else if(pSortInfo
->nHeaderID
== LISTVIEW_COLUMN_ATTRIB
)
427 _ILGetFileAttributes(pItemIdList1
, strName1
, MAX_PATH
);
428 _ILGetFileAttributes(pItemIdList2
, strName2
, MAX_PATH
);
429 nDiff
= strcasecmp(strName1
, strName2
);
431 /* Sort by FileName: Folder or Files can be sorted */
432 else if(pSortInfo
->nHeaderID
== LISTVIEW_COLUMN_NAME
|| bIsBothFolder
)
435 _ILSimpleGetText(pItemIdList1
, strName1
, MAX_PATH
);
436 _ILSimpleGetText(pItemIdList2
, strName2
, MAX_PATH
);
437 nDiff
= strcasecmp(strName1
, strName2
);
439 /* Sort by File Size, Only valid for Files */
440 else if(pSortInfo
->nHeaderID
== LISTVIEW_COLUMN_SIZE
)
442 nDiff
= (INT
)(_ILGetFileSize(pItemIdList1
, NULL
, 0) - _ILGetFileSize(pItemIdList2
, NULL
, 0));
444 /* Sort by File Type, Only valid for Files */
445 else if(pSortInfo
->nHeaderID
== LISTVIEW_COLUMN_TYPE
)
448 _ILGetFileType(pItemIdList1
, strName1
, MAX_PATH
);
449 _ILGetFileType(pItemIdList2
, strName2
, MAX_PATH
);
450 nDiff
= strcasecmp(strName1
, strName2
);
453 /* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */
457 _ILSimpleGetText(pItemIdList1
, strName1
, MAX_PATH
);
458 _ILSimpleGetText(pItemIdList2
, strName2
, MAX_PATH
);
459 nDiff
= strcasecmp(strName1
, strName2
);
462 if(!pSortInfo
->bIsAscending
)
471 /**********************************************************
472 * LV_FindItemByPidl()
474 static int LV_FindItemByPidl(
475 IShellViewImpl
* This
,
479 ZeroMemory(&lvItem
, sizeof(LVITEMA
));
480 lvItem
.mask
= LVIF_PARAM
;
481 for(lvItem
.iItem
= 0; ListView_GetItemA(This
->hWndList
, &lvItem
); lvItem
.iItem
++)
483 LPITEMIDLIST currentpidl
= (LPITEMIDLIST
) lvItem
.lParam
;
484 HRESULT hr
= IShellFolder_CompareIDs(This
->pSFParent
, 0, pidl
, currentpidl
);
485 if(SUCCEEDED(hr
) && !HRESULT_CODE(hr
))
493 /**********************************************************
496 static BOOLEAN
LV_AddItem(IShellViewImpl
* This
, LPCITEMIDLIST pidl
)
500 TRACE("(%p)(pidl=%p)\n", This
, pidl
);
502 ZeroMemory(&lvItem
, sizeof(lvItem
)); /* create the listview item*/
503 lvItem
.mask
= LVIF_TEXT
| LVIF_IMAGE
| LVIF_PARAM
; /*set the mask*/
504 lvItem
.iItem
= ListView_GetItemCount(This
->hWndList
); /*add the item to the end of the list*/
505 lvItem
.lParam
= (LPARAM
) ILClone(ILFindLastID(pidl
)); /*set the item's data*/
506 lvItem
.pszText
= LPSTR_TEXTCALLBACKA
; /*get text on a callback basis*/
507 lvItem
.iImage
= I_IMAGECALLBACK
; /*get the image on a callback basis*/
508 return (-1==ListView_InsertItemA(This
->hWndList
, &lvItem
))? FALSE
: TRUE
;
511 /**********************************************************
514 static BOOLEAN
LV_DeleteItem(IShellViewImpl
* This
, LPCITEMIDLIST pidl
)
518 TRACE("(%p)(pidl=%p)\n", This
, pidl
);
520 nIndex
= LV_FindItemByPidl(This
, ILFindLastID(pidl
));
521 return (-1==ListView_DeleteItem(This
->hWndList
, nIndex
))? FALSE
: TRUE
;
524 /**********************************************************
527 static BOOLEAN
LV_RenameItem(IShellViewImpl
* This
, LPCITEMIDLIST pidlOld
, LPCITEMIDLIST pidlNew
)
532 TRACE("(%p)(pidlold=%p pidlnew=%p)\n", This
, pidlOld
, pidlNew
);
534 nItem
= LV_FindItemByPidl(This
, ILFindLastID(pidlOld
));
537 ZeroMemory(&lvItem
, sizeof(lvItem
)); /* create the listview item*/
538 lvItem
.mask
= LVIF_PARAM
; /* only the pidl */
539 lvItem
.iItem
= nItem
;
540 ListView_GetItemA(This
->hWndList
, &lvItem
);
542 SHFree((LPITEMIDLIST
)lvItem
.lParam
);
543 lvItem
.mask
= LVIF_PARAM
;
544 lvItem
.iItem
= nItem
;
545 lvItem
.lParam
= (LPARAM
) ILClone(ILFindLastID(pidlNew
)); /* set the item's data */
546 ListView_SetItemA(This
->hWndList
, &lvItem
);
547 ListView_Update(This
->hWndList
, nItem
);
548 return TRUE
; /* FIXME: better handling */
552 /**********************************************************
553 * ShellView_FillList()
555 * - gets the objectlist from the shellfolder
557 * - fills the list into the view
560 static HRESULT
ShellView_FillList(IShellViewImpl
* This
)
562 LPENUMIDLIST pEnumIDList
;
571 /* get the itemlist from the shfolder*/
572 hRes
= IShellFolder_EnumObjects(This
->pSFParent
,This
->hWnd
, SHCONTF_NONFOLDERS
| SHCONTF_FOLDERS
, &pEnumIDList
);
580 /* create a pointer array */
581 hdpa
= pDPA_Create(16);
584 return(E_OUTOFMEMORY
);
587 /* copy the items into the array*/
588 while((S_OK
== IEnumIDList_Next(pEnumIDList
,1, &pidl
, &dwFetched
)) && dwFetched
)
590 if (pDPA_InsertPtr(hdpa
, 0x7fff, pidl
) == -1)
597 pDPA_Sort(hdpa
, ShellView_CompareItems
, (LPARAM
)This
->pSFParent
);
599 /*turn the listview's redrawing off*/
600 SendMessageA(This
->hWndList
, WM_SETREDRAW
, FALSE
, 0);
602 for (i
=0; i
< DPA_GetPtrCount(hdpa
); ++i
) /* DPA_GetPtrCount is a macro*/
604 pidl
= (LPITEMIDLIST
)pDPA_GetPtr(hdpa
, i
);
606 /* in a commdlg This works as a filemask*/
607 if ( IncludeObject(This
, pidl
)==S_OK
)
608 LV_AddItem(This
, pidl
);
612 /*turn the listview's redrawing back on and force it to draw*/
613 SendMessageA(This
->hWndList
, WM_SETREDRAW
, TRUE
, 0);
615 IEnumIDList_Release(pEnumIDList
); /* destroy the list*/
621 /**********************************************************
622 * ShellView_OnCreate()
624 static LRESULT
ShellView_OnCreate(IShellViewImpl
* This
)
627 NOTIFYREGISTER ntreg
;
628 IPersistFolder2
* ppf2
= NULL
;
632 if(ShellView_CreateList(This
))
634 if(ShellView_InitList(This
))
636 ShellView_FillList(This
);
642 if (SUCCEEDED(IShellFolder_CreateViewObject(This
->pSFParent
, This
->hWnd
, &IID_IDropTarget
, (LPVOID
*)&pdt
)))
644 pRegisterDragDrop(This
->hWnd
, pdt
);
645 IDropTarget_Release(pdt
);
649 /* register for receiving notifications */
650 IShellFolder_QueryInterface(This
->pSFParent
, &IID_IPersistFolder2
, (LPVOID
*)&ppf2
);
653 IPersistFolder2_GetCurFolder(ppf2
, &ntreg
.pidlPath
);
654 ntreg
.bWatchSubtree
= FALSE
;
655 This
->hNotify
= SHChangeNotifyRegister(This
->hWnd
, SHCNF_IDLIST
, SHCNE_ALLEVENTS
, SHV_CHANGE_NOTIFY
, 1, &ntreg
);
656 SHFree(ntreg
.pidlPath
);
657 IPersistFolder2_Release(ppf2
);
660 This
->hAccel
= LoadAcceleratorsA(shell32_hInstance
, "shv_accel");
665 /**********************************************************
666 * #### Handling of the menus ####
669 /**********************************************************
670 * ShellView_BuildFileMenu()
672 static HMENU
ShellView_BuildFileMenu(IShellViewImpl
* This
)
673 { CHAR szText
[MAX_PATH
];
678 TRACE("(%p)\n",This
);
680 hSubMenu
= CreatePopupMenu();
682 { /*get the number of items in our global array*/
683 for(nTools
= 0; Tools
[nTools
].idCommand
!= -1; nTools
++){}
685 /*add the menu items*/
686 for(i
= 0; i
< nTools
; i
++)
688 LoadStringA(shell32_hInstance
, Tools
[i
].idMenuString
, szText
, MAX_PATH
);
690 ZeroMemory(&mii
, sizeof(mii
));
691 mii
.cbSize
= sizeof(mii
);
692 mii
.fMask
= MIIM_TYPE
| MIIM_ID
| MIIM_STATE
;
694 if(TBSTYLE_SEP
!= Tools
[i
].bStyle
) /* no seperator*/
696 mii
.fType
= MFT_STRING
;
697 mii
.fState
= MFS_ENABLED
;
698 mii
.dwTypeData
= szText
;
699 mii
.wID
= Tools
[i
].idCommand
;
703 mii
.fType
= MFT_SEPARATOR
;
705 /* tack This item onto the end of the menu */
706 InsertMenuItemA(hSubMenu
, (UINT
)-1, TRUE
, &mii
);
709 TRACE("-- return (menu=0x%x)\n",hSubMenu
);
712 /**********************************************************
713 * ShellView_MergeFileMenu()
715 static void ShellView_MergeFileMenu(IShellViewImpl
* This
, HMENU hSubMenu
)
716 { TRACE("(%p)->(submenu=0x%08x) stub\n",This
,hSubMenu
);
719 { /*insert This item at the beginning of the menu */
720 _InsertMenuItem(hSubMenu
, 0, TRUE
, 0, MFT_SEPARATOR
, NULL
, MFS_ENABLED
);
721 _InsertMenuItem(hSubMenu
, 0, TRUE
, IDM_MYFILEITEM
, MFT_STRING
, "dummy45", MFS_ENABLED
);
727 /**********************************************************
728 * ShellView_MergeViewMenu()
731 static void ShellView_MergeViewMenu(IShellViewImpl
* This
, HMENU hSubMenu
)
734 TRACE("(%p)->(submenu=0x%08x)\n",This
,hSubMenu
);
737 { /*add a separator at the correct position in the menu*/
738 _InsertMenuItem(hSubMenu
, FCIDM_MENU_VIEW_SEP_OPTIONS
, FALSE
, 0, MFT_SEPARATOR
, NULL
, MFS_ENABLED
);
740 ZeroMemory(&mii
, sizeof(mii
));
741 mii
.cbSize
= sizeof(mii
);
742 mii
.fMask
= MIIM_SUBMENU
| MIIM_TYPE
| MIIM_DATA
;;
743 mii
.fType
= MFT_STRING
;
744 mii
.dwTypeData
= "View";
745 mii
.hSubMenu
= LoadMenuA(shell32_hInstance
, "MENU_001");
746 InsertMenuItemA(hSubMenu
, FCIDM_MENU_VIEW_SEP_OPTIONS
, FALSE
, &mii
);
750 /**********************************************************
751 * ShellView_GetSelections()
753 * - fills the this->apidl list with the selected objects
756 * number of selected items
758 static UINT
ShellView_GetSelections(IShellViewImpl
* This
)
768 This
->cidl
= ListView_GetSelectedCount(This
->hWndList
);
769 This
->apidl
= (LPITEMIDLIST
*)SHAlloc(This
->cidl
* sizeof(LPITEMIDLIST
));
771 TRACE("selected=%i\n", This
->cidl
);
775 TRACE("-- Items selected =%u\n", This
->cidl
);
777 ZeroMemory(&lvItem
, sizeof(lvItem
));
778 lvItem
.mask
= LVIF_STATE
| LVIF_PARAM
;
779 lvItem
.stateMask
= LVIS_SELECTED
;
781 while(ListView_GetItemA(This
->hWndList
, &lvItem
) && (i
< This
->cidl
))
783 if(lvItem
.state
& LVIS_SELECTED
)
785 This
->apidl
[i
] = (LPITEMIDLIST
)lvItem
.lParam
;
787 TRACE("-- selected Item found\n");
795 /**********************************************************
796 * ShellView_DoContextMenu()
798 static void ShellView_DoContextMenu(IShellViewImpl
* This
, WORD x
, WORD y
, BOOL bDefault
)
802 BOOL fExplore
= FALSE
;
804 LPCONTEXTMENU pContextMenu
= NULL
;
805 IContextMenu
* pCM
= NULL
;
806 CMINVOKECOMMANDINFO cmi
;
808 TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This
, x
, y
, bDefault
);
810 /* look, what's selected and create a context menu object of it*/
811 if( ShellView_GetSelections(This
) )
813 IShellFolder_GetUIObjectOf( This
->pSFParent
, This
->hWndParent
, This
->cidl
, This
->apidl
,
814 (REFIID
)&IID_IContextMenu
, NULL
, (LPVOID
*)&pContextMenu
);
818 TRACE("-- pContextMenu\n");
819 hMenu
= CreatePopupMenu();
823 /* See if we are in Explore or Open mode. If the browser's tree is present, we are in Explore mode.*/
824 if(SUCCEEDED(IShellBrowser_GetControlWindow(This
->pShellBrowser
,FCW_TREE
, &hwndTree
)) && hwndTree
)
826 TRACE("-- explore mode\n");
830 /* build the flags depending on what we can do with the selected item */
831 wFlags
= CMF_NORMAL
| (This
->cidl
!= 1 ? 0 : CMF_CANRENAME
) | (fExplore
? CMF_EXPLORE
: 0);
833 /* let the ContextMenu merge its items in */
834 if (SUCCEEDED(IContextMenu_QueryContextMenu( pContextMenu
, hMenu
, 0, FCIDM_SHVIEWFIRST
, FCIDM_SHVIEWLAST
, wFlags
)))
838 TRACE("-- get menu default command\n");
839 uCommand
= GetMenuDefaultItem(hMenu
, FALSE
, GMDI_GOINTOPOPUPS
);
843 TRACE("-- track popup\n");
844 uCommand
= TrackPopupMenu( hMenu
,TPM_LEFTALIGN
| TPM_RETURNCMD
,x
,y
,0,This
->hWnd
,NULL
);
849 TRACE("-- uCommand=%u\n", uCommand
);
850 if (IsInCommDlg(This
) && ((uCommand
==FCIDM_SHVIEW_EXPLORE
) || (uCommand
==FCIDM_SHVIEW_OPEN
)))
852 TRACE("-- dlg: OnDefaultCommand\n");
853 OnDefaultCommand(This
);
857 TRACE("-- explore -- invoke command\n");
858 ZeroMemory(&cmi
, sizeof(cmi
));
859 cmi
.cbSize
= sizeof(cmi
);
860 cmi
.hwnd
= This
->hWndParent
; /* this window has to answer CWM_GETISHELLBROWSER */
861 cmi
.lpVerb
= (LPCSTR
)MAKEINTRESOURCEA(uCommand
);
862 IContextMenu_InvokeCommand(pContextMenu
, &cmi
);
869 IContextMenu_Release(pContextMenu
);
872 else /* background context menu */
874 hMenu
= CreatePopupMenu();
876 pCM
= ISvBgCm_Constructor(This
->pSFParent
);
877 IContextMenu_QueryContextMenu(pCM
, hMenu
, 0, FCIDM_SHVIEWFIRST
, FCIDM_SHVIEWLAST
, 0);
879 uCommand
= TrackPopupMenu( hMenu
, TPM_LEFTALIGN
| TPM_RETURNCMD
,x
,y
,0,This
->hWnd
,NULL
);
882 TRACE("-- (%p)->(uCommand=0x%08x )\n",This
, uCommand
);
884 ZeroMemory(&cmi
, sizeof(cmi
));
885 cmi
.cbSize
= sizeof(cmi
);
886 cmi
.lpVerb
= (LPCSTR
)MAKEINTRESOURCEA(uCommand
);
887 cmi
.hwnd
= This
->hWndParent
;
888 IContextMenu_InvokeCommand(pCM
, &cmi
);
890 IContextMenu_Release(pCM
);
894 /**********************************************************
895 * ##### message handling #####
898 /**********************************************************
901 static LRESULT
ShellView_OnSize(IShellViewImpl
* This
, WORD wWidth
, WORD wHeight
)
903 TRACE("%p width=%u height=%u\n",This
, wWidth
,wHeight
);
905 /*resize the ListView to fit our window*/
908 MoveWindow(This
->hWndList
, 0, 0, wWidth
, wHeight
, TRUE
);
913 /**********************************************************
914 * ShellView_OnDeactivate()
919 static void ShellView_OnDeactivate(IShellViewImpl
* This
)
923 if(This
->uState
!= SVUIA_DEACTIVATE
)
927 IShellBrowser_SetMenuSB(This
->pShellBrowser
,0, 0, 0);
928 IShellBrowser_RemoveMenusSB(This
->pShellBrowser
,This
->hMenu
);
929 DestroyMenu(This
->hMenu
);
933 This
->uState
= SVUIA_DEACTIVATE
;
937 /**********************************************************
938 * ShellView_OnActivate()
940 static LRESULT
ShellView_OnActivate(IShellViewImpl
* This
, UINT uState
)
941 { OLEMENUGROUPWIDTHS omw
= { {0, 0, 0, 0, 0, 0} };
943 CHAR szText
[MAX_PATH
];
945 TRACE("%p uState=%x\n",This
,uState
);
947 /*don't do anything if the state isn't really changing */
948 if(This
->uState
== uState
)
953 ShellView_OnDeactivate(This
);
955 /*only do This if we are active */
956 if(uState
!= SVUIA_DEACTIVATE
)
959 This
->hMenu
= CreateMenu();
963 IShellBrowser_InsertMenusSB(This
->pShellBrowser
, This
->hMenu
, &omw
);
964 TRACE("-- after fnInsertMenusSB\n");
966 /*build the top level menu get the menu item's text*/
967 strcpy(szText
,"dummy 31");
969 ZeroMemory(&mii
, sizeof(mii
));
970 mii
.cbSize
= sizeof(mii
);
971 mii
.fMask
= MIIM_SUBMENU
| MIIM_TYPE
| MIIM_STATE
;
972 mii
.fType
= MFT_STRING
;
973 mii
.fState
= MFS_ENABLED
;
974 mii
.dwTypeData
= szText
;
975 mii
.hSubMenu
= ShellView_BuildFileMenu(This
);
977 /*insert our menu into the menu bar*/
980 InsertMenuItemA(This
->hMenu
, FCIDM_MENU_HELP
, FALSE
, &mii
);
983 /*get the view menu so we can merge with it*/
984 ZeroMemory(&mii
, sizeof(mii
));
985 mii
.cbSize
= sizeof(mii
);
986 mii
.fMask
= MIIM_SUBMENU
;
988 if(GetMenuItemInfoA(This
->hMenu
, FCIDM_MENU_VIEW
, FALSE
, &mii
))
990 ShellView_MergeViewMenu(This
, mii
.hSubMenu
);
993 /*add the items that should only be added if we have the focus*/
994 if(SVUIA_ACTIVATE_FOCUS
== uState
)
996 /*get the file menu so we can merge with it */
997 ZeroMemory(&mii
, sizeof(mii
));
998 mii
.cbSize
= sizeof(mii
);
999 mii
.fMask
= MIIM_SUBMENU
;
1001 if(GetMenuItemInfoA(This
->hMenu
, FCIDM_MENU_FILE
, FALSE
, &mii
))
1003 ShellView_MergeFileMenu(This
, mii
.hSubMenu
);
1006 TRACE("-- before fnSetMenuSB\n");
1007 IShellBrowser_SetMenuSB(This
->pShellBrowser
, This
->hMenu
, 0, This
->hWnd
);
1010 This
->uState
= uState
;
1015 /**********************************************************
1016 * ShellView_OnSetFocus()
1019 static LRESULT
ShellView_OnSetFocus(IShellViewImpl
* This
)
1023 /* Tell the browser one of our windows has received the focus. This
1024 should always be done before merging menus (OnActivate merges the
1025 menus) if one of our windows has the focus.*/
1027 IShellBrowser_OnViewWindowActive(This
->pShellBrowser
,(IShellView
*) This
);
1028 ShellView_OnActivate(This
, SVUIA_ACTIVATE_FOCUS
);
1030 /* Set the focus to the listview */
1031 SetFocus(This
->hWndList
);
1033 /* Notify the ICommDlgBrowser interface */
1034 OnStateChange(This
,CDBOSC_SETFOCUS
);
1039 /**********************************************************
1040 * ShellView_OnKillFocus()
1042 static LRESULT
ShellView_OnKillFocus(IShellViewImpl
* This
)
1044 TRACE("(%p) stub\n",This
);
1046 ShellView_OnActivate(This
, SVUIA_ACTIVATE_NOFOCUS
);
1047 /* Notify the ICommDlgBrowser */
1048 OnStateChange(This
,CDBOSC_KILLFOCUS
);
1053 /**********************************************************
1054 * ShellView_OnCommand()
1057 * the CmdID's are the ones from the context menu
1059 static LRESULT
ShellView_OnCommand(IShellViewImpl
* This
,DWORD dwCmdID
, DWORD dwCmd
, HWND hwndCmd
)
1061 TRACE("(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",This
, dwCmdID
, dwCmd
, hwndCmd
);
1065 case FCIDM_SHVIEW_SMALLICON
:
1066 This
->FolderSettings
.ViewMode
= FVM_SMALLICON
;
1067 SetStyle (This
, LVS_SMALLICON
, LVS_TYPEMASK
);
1071 case FCIDM_SHVIEW_BIGICON
:
1072 This
->FolderSettings
.ViewMode
= FVM_ICON
;
1073 SetStyle (This
, LVS_ICON
, LVS_TYPEMASK
);
1077 case FCIDM_SHVIEW_LISTVIEW
:
1078 This
->FolderSettings
.ViewMode
= FVM_LIST
;
1079 SetStyle (This
, LVS_LIST
, LVS_TYPEMASK
);
1083 case FCIDM_SHVIEW_REPORTVIEW
:
1084 This
->FolderSettings
.ViewMode
= FVM_DETAILS
;
1085 SetStyle (This
, LVS_REPORT
, LVS_TYPEMASK
);
1089 /* the menu-ID's for sorting are 0x30... see shrec.rc */
1094 This
->ListViewSortInfo
.nHeaderID
= (LPARAM
) (dwCmdID
- 0x30);
1095 This
->ListViewSortInfo
.bIsAscending
= TRUE
;
1096 This
->ListViewSortInfo
.nLastHeaderID
= This
->ListViewSortInfo
.nHeaderID
;
1097 ListView_SortItems(This
->hWndList
, ShellView_ListViewCompareItems
, (LPARAM
) (&(This
->ListViewSortInfo
)));
1101 TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID
);
1106 /**********************************************************
1107 * ShellView_OnNotify()
1110 static LRESULT
ShellView_OnNotify(IShellViewImpl
* This
, UINT CtlID
, LPNMHDR lpnmh
)
1111 { LPNMLISTVIEW lpnmlv
= (LPNMLISTVIEW
)lpnmh
;
1112 NMLVDISPINFOA
*lpdi
= (NMLVDISPINFOA
*)lpnmh
;
1115 TRACE("%p CtlID=%u lpnmh->code=%x\n",This
,CtlID
,lpnmh
->code
);
1120 TRACE("-- NM_SETFOCUS %p\n",This
);
1121 ShellView_OnSetFocus(This
);
1125 TRACE("-- NM_KILLFOCUS %p\n",This
);
1126 ShellView_OnDeactivate(This
);
1127 /* Notify the ICommDlgBrowser interface */
1128 OnStateChange(This
,CDBOSC_KILLFOCUS
);
1132 TRACE("-- HDN_ENDTRACKA %p\n",This
);
1133 /*nColumn1 = ListView_GetColumnWidth(This->hWndList, 0);
1134 nColumn2 = ListView_GetColumnWidth(This->hWndList, 1);*/
1137 case LVN_DELETEITEM
:
1138 TRACE("-- LVN_DELETEITEM %p\n",This
);
1139 SHFree((LPITEMIDLIST
)lpnmlv
->lParam
); /*delete the pidl because we made a copy of it*/
1142 case LVN_ITEMACTIVATE
:
1143 TRACE("-- LVN_ITEMACTIVATE %p\n",This
);
1144 OnStateChange(This
, CDBOSC_SELCHANGE
); /* the browser will get the IDataObject now */
1145 ShellView_DoContextMenu(This
, 0, 0, TRUE
);
1148 case LVN_COLUMNCLICK
:
1149 This
->ListViewSortInfo
.nHeaderID
= lpnmlv
->iSubItem
;
1150 if(This
->ListViewSortInfo
.nLastHeaderID
== This
->ListViewSortInfo
.nHeaderID
)
1152 This
->ListViewSortInfo
.bIsAscending
= !This
->ListViewSortInfo
.bIsAscending
;
1156 This
->ListViewSortInfo
.bIsAscending
= TRUE
;
1158 This
->ListViewSortInfo
.nLastHeaderID
= This
->ListViewSortInfo
.nHeaderID
;
1160 ListView_SortItems(lpnmlv
->hdr
.hwndFrom
, ShellView_ListViewCompareItems
, (LPARAM
) (&(This
->ListViewSortInfo
)));
1163 case LVN_GETDISPINFOA
:
1164 case LVN_GETDISPINFOW
:
1165 TRACE("-- LVN_GETDISPINFO %p\n",This
);
1166 pidl
= (LPITEMIDLIST
)lpdi
->item
.lParam
;
1168 if(lpdi
->item
.mask
& LVIF_TEXT
) /* text requested */
1170 if (This
->pSF2Parent
)
1173 IShellFolder2_GetDetailsOf(This
->pSF2Parent
, pidl
, lpdi
->item
.iSubItem
, &sd
);
1174 if (lpnmh
->code
== LVN_GETDISPINFOA
)
1176 StrRetToStrNA( lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
, &sd
.str
, NULL
);
1177 TRACE("-- text=%s\n",lpdi
->item
.pszText
);
1179 else /* LVN_GETDISPINFOW */
1181 StrRetToStrNW( lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
, &sd
.str
, NULL
);
1182 TRACE("-- text=%s\n",debugstr_w((WCHAR
*)(lpdi
->item
.pszText
)));
1190 if(lpdi
->item
.mask
& LVIF_IMAGE
) /* image requested */
1192 lpdi
->item
.iImage
= SHMapPIDLToSystemImageListIndex(This
->pSFParent
, pidl
, 0);
1196 case LVN_ITEMCHANGED
:
1197 TRACE("-- LVN_ITEMCHANGED %p\n",This
);
1198 OnStateChange(This
, CDBOSC_SELCHANGE
); /* the browser will get the IDataObject now */
1202 case LVN_BEGINRDRAG
:
1203 TRACE("-- LVN_BEGINDRAG\n");
1205 if (ShellView_GetSelections(This
))
1208 DWORD dwAttributes
= SFGAO_CANLINK
;
1209 DWORD dwEffect
= DROPEFFECT_COPY
| DROPEFFECT_MOVE
;
1213 if (SUCCEEDED(IShellFolder_GetUIObjectOf(This
->pSFParent
, This
->hWnd
, This
->cidl
, This
->apidl
, &IID_IDataObject
,0,(LPVOID
*)&pda
)))
1215 IDropSource
* pds
= (IDropSource
*)&(This
->lpvtblDropSource
); /* own DropSource interface */
1217 if (SUCCEEDED(IShellFolder_GetAttributesOf(This
->pSFParent
, This
->cidl
, This
->apidl
, &dwAttributes
)))
1219 if (dwAttributes
& SFGAO_CANLINK
)
1221 dwEffect
|= DROPEFFECT_LINK
;
1228 pDoDragDrop(pda
, pds
, dwEffect
, &dwEffect
);
1230 IDataObject_Release(pda
);
1236 case LVN_BEGINLABELEDITA
:
1238 DWORD dwAttr
= SFGAO_CANRENAME
;
1239 pidl
= (LPITEMIDLIST
)lpdi
->item
.lParam
;
1241 TRACE("-- LVN_BEGINLABELEDITA %p\n",This
);
1243 IShellFolder_GetAttributesOf(This
->pSFParent
, 1, &pidl
, &dwAttr
);
1244 if (SFGAO_CANRENAME
& dwAttr
)
1252 case LVN_ENDLABELEDITA
:
1254 TRACE("-- LVN_ENDLABELEDITA %p\n",This
);
1255 if (lpdi
->item
.pszText
)
1258 WCHAR wszNewName
[MAX_PATH
];
1261 ZeroMemory(&lvItem
, sizeof(LVITEMA
));
1262 lvItem
.iItem
= lpdi
->item
.iItem
;
1263 lvItem
.mask
= LVIF_PARAM
;
1264 ListView_GetItemA(This
->hWndList
, &lvItem
);
1266 pidl
= (LPITEMIDLIST
)lpdi
->item
.lParam
;
1267 if (!MultiByteToWideChar( CP_ACP
, 0, lpdi
->item
.pszText
, -1, wszNewName
, MAX_PATH
))
1268 wszNewName
[MAX_PATH
-1] = 0;
1269 hr
= IShellFolder_SetNameOf(This
->pSFParent
, 0, pidl
, wszNewName
, SHGDN_INFOLDER
, &pidl
);
1271 if(SUCCEEDED(hr
) && pidl
)
1273 lvItem
.mask
= LVIF_PARAM
;
1274 lvItem
.lParam
= (LPARAM
)pidl
;
1275 ListView_SetItemA(This
->hWndList
, &lvItem
);
1286 msg.hwnd = This->hWnd;
1287 msg.message = WM_KEYDOWN;
1288 msg.wParam = plvKeyDown->wVKey;
1293 LPNMLVKEYDOWN plvKeyDown
= (LPNMLVKEYDOWN
) lpnmh
;
1295 /* initiate a rename of the selected file or directory */
1296 if(plvKeyDown
->wVKey
== VK_F2
)
1298 /* see how many files are selected */
1299 int i
= ListView_GetSelectedCount(This
->hWndList
);
1301 /* get selected item */
1304 /* get selected item */
1305 i
= ListView_GetNextItem(This
->hWndList
, -1,
1308 ListView_EnsureVisible(This
->hWndList
, i
, 0);
1309 ListView_EditLabelA(This
->hWndList
, i
);
1313 TranslateAccelerator(This
->hWnd
, This
->hAccel
, &msg
)
1315 else if(plvKeyDown
->wVKey
== VK_DELETE
)
1319 LPITEMIDLIST
* pItems
;
1322 IShellFolder_QueryInterface(This
->pSFParent
, &IID_ISFHelper
,
1325 if(!(i
= ListView_GetSelectedCount(This
->hWndList
)))
1328 /* allocate memory for the pidl array */
1329 pItems
= HeapAlloc(GetProcessHeap(), 0,
1330 sizeof(LPITEMIDLIST
) * i
);
1332 /* retrieve all selected items */
1335 while(ListView_GetSelectedCount(This
->hWndList
) > i
)
1337 /* get selected item */
1338 item_index
= ListView_GetNextItem(This
->hWndList
,
1339 item_index
, LVNI_SELECTED
);
1340 item
.iItem
= item_index
;
1341 ListView_GetItemA(This
->hWndList
, &item
);
1344 pItems
[i
] = (LPITEMIDLIST
)item
.lParam
;
1349 /* perform the item deletion */
1350 ISFHelper_DeleteItems(psfhlp
, i
, pItems
);
1352 /* free pidl array memory */
1353 HeapFree(GetProcessHeap(), 0, pItems
);
1356 FIXME("LVN_KEYDOWN key=0x%08x\n",plvKeyDown
->wVKey
);
1361 TRACE("-- %p WM_COMMAND %x unhandled\n", This
, lpnmh
->code
);
1367 /**********************************************************
1368 * ShellView_OnChange()
1371 static LRESULT
ShellView_OnChange(IShellViewImpl
* This
, LPITEMIDLIST
* Pidls
, LONG wEventId
)
1374 TRACE("(%p)(%p,%p,0x%08lx)\n", This
, Pidls
[0], Pidls
[1], wEventId
);
1379 LV_AddItem(This
, Pidls
[0]);
1383 LV_DeleteItem(This
, Pidls
[0]);
1385 case SHCNE_RENAMEFOLDER
:
1386 case SHCNE_RENAMEITEM
:
1387 LV_RenameItem(This
, Pidls
[0], Pidls
[1]);
1389 case SHCNE_UPDATEITEM
:
1394 /**********************************************************
1398 static LRESULT CALLBACK
ShellView_WndProc(HWND hWnd
, UINT uMessage
, WPARAM wParam
, LPARAM lParam
)
1400 IShellViewImpl
* pThis
= (IShellViewImpl
*)GetWindowLongA(hWnd
, GWL_USERDATA
);
1401 LPCREATESTRUCTA lpcs
;
1403 TRACE("(hwnd=%x msg=%x wparm=%x lparm=%lx)\n",hWnd
, uMessage
, wParam
, lParam
);
1408 lpcs
= (LPCREATESTRUCTA
)lParam
;
1409 pThis
= (IShellViewImpl
*)(lpcs
->lpCreateParams
);
1410 SetWindowLongA(hWnd
, GWL_USERDATA
, (LONG
)pThis
);
1411 pThis
->hWnd
= hWnd
; /*set the window handle*/
1414 case WM_SIZE
: return ShellView_OnSize(pThis
,LOWORD(lParam
), HIWORD(lParam
));
1415 case WM_SETFOCUS
: return ShellView_OnSetFocus(pThis
);
1416 case WM_KILLFOCUS
: return ShellView_OnKillFocus(pThis
);
1417 case WM_CREATE
: return ShellView_OnCreate(pThis
);
1418 case WM_ACTIVATE
: return ShellView_OnActivate(pThis
, SVUIA_ACTIVATE_FOCUS
);
1419 case WM_NOTIFY
: return ShellView_OnNotify(pThis
,(UINT
)wParam
, (LPNMHDR
)lParam
);
1420 case WM_COMMAND
: return ShellView_OnCommand(pThis
,
1421 GET_WM_COMMAND_ID(wParam
, lParam
),
1422 GET_WM_COMMAND_CMD(wParam
, lParam
),
1423 GET_WM_COMMAND_HWND(wParam
, lParam
));
1424 case SHV_CHANGE_NOTIFY
: return ShellView_OnChange(pThis
, (LPITEMIDLIST
*)wParam
, (LONG
)lParam
);
1426 case WM_CONTEXTMENU
: ShellView_DoContextMenu(pThis
, LOWORD(lParam
), HIWORD(lParam
), FALSE
);
1429 case WM_SHOWWINDOW
: UpdateWindow(pThis
->hWndList
);
1432 case WM_GETDLGCODE
: return SendMessageA(pThis
->hWndList
,uMessage
,0,0);
1434 case WM_DESTROY
: if(GetShellOle())
1436 pRevokeDragDrop(pThis
->hWnd
);
1438 SHChangeNotifyDeregister(pThis
->hNotify
);
1442 return DefWindowProcA (hWnd
, uMessage
, wParam
, lParam
);
1444 /**********************************************************
1447 * The INTERFACE of the IShellView object
1450 **********************************************************
1451 * IShellView_QueryInterface
1453 static HRESULT WINAPI
IShellView_fnQueryInterface(IShellView
* iface
,REFIID riid
, LPVOID
*ppvObj
)
1455 ICOM_THIS(IShellViewImpl
, iface
);
1457 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,debugstr_guid(riid
),ppvObj
);
1461 if(IsEqualIID(riid
, &IID_IUnknown
))
1465 else if(IsEqualIID(riid
, &IID_IShellView
))
1467 *ppvObj
= (IShellView
*)This
;
1469 else if(IsEqualIID(riid
, &IID_IOleCommandTarget
))
1471 *ppvObj
= (IOleCommandTarget
*)&(This
->lpvtblOleCommandTarget
);
1473 else if(IsEqualIID(riid
, &IID_IDropTarget
))
1475 *ppvObj
= (IDropTarget
*)&(This
->lpvtblDropTarget
);
1477 else if(IsEqualIID(riid
, &IID_IDropSource
))
1479 *ppvObj
= (IDropSource
*)&(This
->lpvtblDropSource
);
1481 else if(IsEqualIID(riid
, &IID_IViewObject
))
1483 *ppvObj
= (IViewObject
*)&(This
->lpvtblViewObject
);
1488 IUnknown_AddRef( (IUnknown
*)*ppvObj
);
1489 TRACE("-- Interface: (%p)->(%p)\n",ppvObj
,*ppvObj
);
1492 TRACE("-- Interface: E_NOINTERFACE\n");
1493 return E_NOINTERFACE
;
1496 /**********************************************************
1499 static ULONG WINAPI
IShellView_fnAddRef(IShellView
* iface
)
1501 ICOM_THIS(IShellViewImpl
, iface
);
1503 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1506 return ++(This
->ref
);
1508 /**********************************************************
1509 * IShellView_Release
1511 static ULONG WINAPI
IShellView_fnRelease(IShellView
* iface
)
1513 ICOM_THIS(IShellViewImpl
, iface
);
1515 TRACE("(%p)->()\n",This
);
1521 TRACE(" destroying IShellView(%p)\n",This
);
1524 IShellFolder_Release(This
->pSFParent
);
1526 if(This
->pSF2Parent
)
1527 IShellFolder2_Release(This
->pSF2Parent
);
1530 SHFree(This
->apidl
);
1532 if (This
->pCommDlgBrowser
)
1533 ICommDlgBrowser_Release(This
->pCommDlgBrowser
);
1535 HeapFree(GetProcessHeap(),0,This
);
1541 /**********************************************************
1542 * ShellView_GetWindow
1544 static HRESULT WINAPI
IShellView_fnGetWindow(IShellView
* iface
,HWND
* phWnd
)
1546 ICOM_THIS(IShellViewImpl
, iface
);
1548 TRACE("(%p)\n",This
);
1550 *phWnd
= This
->hWnd
;
1555 static HRESULT WINAPI
IShellView_fnContextSensitiveHelp(IShellView
* iface
,BOOL fEnterMode
)
1557 ICOM_THIS(IShellViewImpl
, iface
);
1559 FIXME("(%p) stub\n",This
);
1564 /**********************************************************
1565 * IShellView_TranslateAccelerator
1568 * use the accel functions
1570 static HRESULT WINAPI
IShellView_fnTranslateAccelerator(IShellView
* iface
,LPMSG lpmsg
)
1573 ICOM_THIS(IShellViewImpl
, iface
);
1575 FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This
,lpmsg
, lpmsg
->hwnd
, lpmsg
->message
, lpmsg
->lParam
, lpmsg
->wParam
);
1578 if ((lpmsg
->message
>=WM_KEYFIRST
) && (lpmsg
->message
>=WM_KEYLAST
))
1580 TRACE("-- key=0x04%x\n",lpmsg
->wParam
) ;
1582 return S_FALSE
; /* not handled */
1585 static HRESULT WINAPI
IShellView_fnEnableModeless(IShellView
* iface
,BOOL fEnable
)
1587 ICOM_THIS(IShellViewImpl
, iface
);
1589 FIXME("(%p) stub\n",This
);
1594 static HRESULT WINAPI
IShellView_fnUIActivate(IShellView
* iface
,UINT uState
)
1596 ICOM_THIS(IShellViewImpl
, iface
);
1599 CHAR szName[MAX_PATH];
1602 int nPartArray
[1] = {-1};
1604 TRACE("(%p)->(state=%x) stub\n",This
, uState
);
1606 /*don't do anything if the state isn't really changing*/
1607 if(This
->uState
== uState
)
1612 /*OnActivate handles the menu merging and internal state*/
1613 ShellView_OnActivate(This
, uState
);
1615 /*only do This if we are active*/
1616 if(uState
!= SVUIA_DEACTIVATE
)
1620 GetFolderPath is not a method of IShellFolder
1621 IShellFolder_GetFolderPath( This->pSFParent, szName, sizeof(szName) );
1623 /* set the number of parts */
1624 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_STATUS
, SB_SETPARTS
, 1,
1625 (LPARAM
)nPartArray
, &lResult
);
1627 /* set the text for the parts */
1629 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA,
1630 0, (LPARAM)szName, &lResult);
1637 static HRESULT WINAPI
IShellView_fnRefresh(IShellView
* iface
)
1639 ICOM_THIS(IShellViewImpl
, iface
);
1641 TRACE("(%p)\n",This
);
1643 ListView_DeleteAllItems(This
->hWndList
);
1644 ShellView_FillList(This
);
1649 static HRESULT WINAPI
IShellView_fnCreateViewWindow(
1651 IShellView
*lpPrevView
,
1652 LPCFOLDERSETTINGS lpfs
,
1653 IShellBrowser
* psb
,
1657 ICOM_THIS(IShellViewImpl
, iface
);
1663 TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This
, lpPrevView
,lpfs
, psb
, prcView
, phWnd
);
1664 TRACE("-- vmode=%x flags=%x left=%i top=%i right=%i bottom=%i\n",lpfs
->ViewMode
, lpfs
->fFlags
,prcView
->left
,prcView
->top
, prcView
->right
, prcView
->bottom
);
1666 /*set up the member variables*/
1667 This
->pShellBrowser
= psb
;
1668 This
->FolderSettings
= *lpfs
;
1670 /*get our parent window*/
1671 IShellBrowser_AddRef(This
->pShellBrowser
);
1672 IShellBrowser_GetWindow(This
->pShellBrowser
, &(This
->hWndParent
));
1674 /* try to get the ICommDlgBrowserInterface, adds a reference !!! */
1675 This
->pCommDlgBrowser
=NULL
;
1676 if ( SUCCEEDED (IShellBrowser_QueryInterface( This
->pShellBrowser
,
1677 (REFIID
)&IID_ICommDlgBrowser
, (LPVOID
*) &This
->pCommDlgBrowser
)))
1679 TRACE("-- CommDlgBrowser\n");
1682 /*if our window class has not been registered, then do so*/
1683 if(!GetClassInfoA(shell32_hInstance
, SV_CLASS_NAME
, &wc
))
1685 ZeroMemory(&wc
, sizeof(wc
));
1686 wc
.style
= CS_HREDRAW
| CS_VREDRAW
;
1687 wc
.lpfnWndProc
= (WNDPROC
) ShellView_WndProc
;
1690 wc
.hInstance
= shell32_hInstance
;
1692 wc
.hCursor
= LoadCursorA (0, IDC_ARROWA
);
1693 wc
.hbrBackground
= (HBRUSH
) (COLOR_WINDOW
+ 1);
1694 wc
.lpszMenuName
= NULL
;
1695 wc
.lpszClassName
= SV_CLASS_NAME
;
1697 if(!RegisterClassA(&wc
))
1701 *phWnd
= CreateWindowExA(0,
1704 WS_CHILD
| WS_VISIBLE
| WS_TABSTOP
,
1707 prcView
->right
- prcView
->left
,
1708 prcView
->bottom
- prcView
->top
,
1716 if(!*phWnd
) return E_FAIL
;
1721 static HRESULT WINAPI
IShellView_fnDestroyViewWindow(IShellView
* iface
)
1723 ICOM_THIS(IShellViewImpl
, iface
);
1725 TRACE("(%p)\n",This
);
1727 /*Make absolutely sure all our UI is cleaned up.*/
1728 IShellView_UIActivate((IShellView
*)This
, SVUIA_DEACTIVATE
);
1732 DestroyMenu(This
->hMenu
);
1735 DestroyWindow(This
->hWnd
);
1736 IShellBrowser_Release(This
->pShellBrowser
);
1741 static HRESULT WINAPI
IShellView_fnGetCurrentInfo(IShellView
* iface
, LPFOLDERSETTINGS lpfs
)
1743 ICOM_THIS(IShellViewImpl
, iface
);
1745 TRACE("(%p)->(%p) vmode=%x flags=%x\n",This
, lpfs
,
1746 This
->FolderSettings
.ViewMode
, This
->FolderSettings
.fFlags
);
1748 if (!lpfs
) return E_INVALIDARG
;
1750 *lpfs
= This
->FolderSettings
;
1754 static HRESULT WINAPI
IShellView_fnAddPropertySheetPages(IShellView
* iface
, DWORD dwReserved
,LPFNADDPROPSHEETPAGE lpfn
, LPARAM lparam
)
1756 ICOM_THIS(IShellViewImpl
, iface
);
1758 FIXME("(%p) stub\n",This
);
1763 static HRESULT WINAPI
IShellView_fnSaveViewState(IShellView
* iface
)
1765 ICOM_THIS(IShellViewImpl
, iface
);
1767 FIXME("(%p) stub\n",This
);
1772 static HRESULT WINAPI
IShellView_fnSelectItem(
1777 ICOM_THIS(IShellViewImpl
, iface
);
1780 TRACE("(%p)->(pidl=%p, 0x%08x) stub\n",This
, pidl
, uFlags
);
1782 i
= LV_FindItemByPidl(This
, pidl
);
1788 if(uFlags
& SVSI_ENSUREVISIBLE
)
1789 ListView_EnsureVisible(This
->hWndList
, i
, 0);
1791 ZeroMemory(&lvItem
, sizeof(LVITEMA
));
1792 lvItem
.mask
= LVIF_STATE
;
1795 while(ListView_GetItemA(This
->hWndList
, &lvItem
))
1797 if (lvItem
.iItem
== i
)
1799 if (uFlags
& SVSI_SELECT
)
1800 lvItem
.state
|= LVIS_SELECTED
;
1802 lvItem
.state
&= ~LVIS_SELECTED
;
1804 if(uFlags
& SVSI_FOCUSED
)
1805 lvItem
.state
&= ~LVIS_FOCUSED
;
1809 if (uFlags
& SVSI_DESELECTOTHERS
)
1810 lvItem
.state
&= ~LVIS_SELECTED
;
1812 ListView_SetItemA(This
->hWndList
, &lvItem
);
1817 if(uFlags
& SVSI_EDIT
)
1818 ListView_EditLabelA(This
->hWndList
, i
);
1824 static HRESULT WINAPI
IShellView_fnGetItemObject(IShellView
* iface
, UINT uItem
, REFIID riid
, LPVOID
*ppvOut
)
1826 ICOM_THIS(IShellViewImpl
, iface
);
1828 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This
, uItem
, debugstr_guid(riid
), ppvOut
);
1834 case SVGIO_BACKGROUND
:
1835 *ppvOut
= ISvBgCm_Constructor(This
->pSFParent
);
1838 case SVGIO_SELECTION
:
1839 ShellView_GetSelections(This
);
1840 IShellFolder_GetUIObjectOf(This
->pSFParent
, This
->hWnd
, This
->cidl
, This
->apidl
, riid
, 0, ppvOut
);
1843 TRACE("-- (%p)->(interface=%p)\n",This
, *ppvOut
);
1845 if(!*ppvOut
) return E_OUTOFMEMORY
;
1850 static HRESULT WINAPI
IShellView_fnEditItem(
1854 ICOM_THIS(IShellViewImpl
, iface
);
1857 TRACE("(%p)->(pidl=%p)\n",This
, pidl
);
1859 i
= LV_FindItemByPidl(This
, pidl
);
1862 SetFocus(This
->hWndList
);
1863 ListView_EditLabelA(This
->hWndList
, i
);
1868 static struct ICOM_VTABLE(IShellView
) svvt
=
1870 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1871 IShellView_fnQueryInterface
,
1872 IShellView_fnAddRef
,
1873 IShellView_fnRelease
,
1874 IShellView_fnGetWindow
,
1875 IShellView_fnContextSensitiveHelp
,
1876 IShellView_fnTranslateAccelerator
,
1877 IShellView_fnEnableModeless
,
1878 IShellView_fnUIActivate
,
1879 IShellView_fnRefresh
,
1880 IShellView_fnCreateViewWindow
,
1881 IShellView_fnDestroyViewWindow
,
1882 IShellView_fnGetCurrentInfo
,
1883 IShellView_fnAddPropertySheetPages
,
1884 IShellView_fnSaveViewState
,
1885 IShellView_fnSelectItem
,
1886 IShellView_fnGetItemObject
,
1887 IShellView_fnEditItem
1891 /**********************************************************
1892 * ISVOleCmdTarget_QueryInterface (IUnknown)
1894 static HRESULT WINAPI
ISVOleCmdTarget_QueryInterface(
1895 IOleCommandTarget
* iface
,
1899 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1901 return IShellFolder_QueryInterface((IShellFolder
*)This
, iid
, ppvObj
);
1904 /**********************************************************
1905 * ISVOleCmdTarget_AddRef (IUnknown)
1907 static ULONG WINAPI
ISVOleCmdTarget_AddRef(
1908 IOleCommandTarget
* iface
)
1910 _ICOM_THIS_From_IOleCommandTarget(IShellFolder
, iface
);
1912 return IShellFolder_AddRef((IShellFolder
*)This
);
1915 /**********************************************************
1916 * ISVOleCmdTarget_Release (IUnknown)
1918 static ULONG WINAPI
ISVOleCmdTarget_Release(
1919 IOleCommandTarget
* iface
)
1921 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1923 return IShellFolder_Release((IShellFolder
*)This
);
1926 /**********************************************************
1927 * ISVOleCmdTarget_QueryStatus (IOleCommandTarget)
1929 static HRESULT WINAPI
ISVOleCmdTarget_QueryStatus(
1930 IOleCommandTarget
*iface
,
1931 const GUID
* pguidCmdGroup
,
1934 OLECMDTEXT
* pCmdText
)
1936 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1938 FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n",
1939 This
, pguidCmdGroup
, debugstr_guid(pguidCmdGroup
), cCmds
, prgCmds
, pCmdText
);
1943 /**********************************************************
1944 * ISVOleCmdTarget_Exec (IOleCommandTarget)
1946 * nCmdID is the OLECMDID_* enumeration
1948 static HRESULT WINAPI
ISVOleCmdTarget_Exec(
1949 IOleCommandTarget
*iface
,
1950 const GUID
* pguidCmdGroup
,
1956 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1958 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n",
1959 This
, debugstr_guid(pguidCmdGroup
), nCmdID
, nCmdexecopt
, pvaIn
, pvaOut
);
1963 static ICOM_VTABLE(IOleCommandTarget
) ctvt
=
1965 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1966 ISVOleCmdTarget_QueryInterface
,
1967 ISVOleCmdTarget_AddRef
,
1968 ISVOleCmdTarget_Release
,
1969 ISVOleCmdTarget_QueryStatus
,
1970 ISVOleCmdTarget_Exec
1973 /**********************************************************
1974 * ISVDropTarget implementation
1977 static HRESULT WINAPI
ISVDropTarget_QueryInterface(
1982 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1984 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,debugstr_guid(riid
),ppvObj
);
1986 return IShellFolder_QueryInterface((IShellFolder
*)This
, riid
, ppvObj
);
1989 static ULONG WINAPI
ISVDropTarget_AddRef( IDropTarget
*iface
)
1991 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1993 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1995 return IShellFolder_AddRef((IShellFolder
*)This
);
1998 static ULONG WINAPI
ISVDropTarget_Release( IDropTarget
*iface
)
2000 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
2002 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
2004 return IShellFolder_Release((IShellFolder
*)This
);
2007 static HRESULT WINAPI
ISVDropTarget_DragEnter(
2009 IDataObject
*pDataObject
,
2015 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
2017 FIXME("Stub: This=%p, DataObject=%p\n",This
,pDataObject
);
2022 static HRESULT WINAPI
ISVDropTarget_DragOver(
2028 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
2030 FIXME("Stub: This=%p\n",This
);
2035 static HRESULT WINAPI
ISVDropTarget_DragLeave(
2038 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
2040 FIXME("Stub: This=%p\n",This
);
2045 static HRESULT WINAPI
ISVDropTarget_Drop(
2047 IDataObject
* pDataObject
,
2052 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
2054 FIXME("Stub: This=%p\n",This
);
2059 static struct ICOM_VTABLE(IDropTarget
) dtvt
=
2061 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2062 ISVDropTarget_QueryInterface
,
2063 ISVDropTarget_AddRef
,
2064 ISVDropTarget_Release
,
2065 ISVDropTarget_DragEnter
,
2066 ISVDropTarget_DragOver
,
2067 ISVDropTarget_DragLeave
,
2071 /**********************************************************
2072 * ISVDropSource implementation
2075 static HRESULT WINAPI
ISVDropSource_QueryInterface(
2080 _ICOM_THIS_From_IDropSource(IShellViewImpl
, iface
);
2082 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,debugstr_guid(riid
),ppvObj
);
2084 return IShellFolder_QueryInterface((IShellFolder
*)This
, riid
, ppvObj
);
2087 static ULONG WINAPI
ISVDropSource_AddRef( IDropSource
*iface
)
2089 _ICOM_THIS_From_IDropSource(IShellViewImpl
, iface
);
2091 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
2093 return IShellFolder_AddRef((IShellFolder
*)This
);
2096 static ULONG WINAPI
ISVDropSource_Release( IDropSource
*iface
)
2098 _ICOM_THIS_From_IDropSource(IShellViewImpl
, iface
);
2100 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
2102 return IShellFolder_Release((IShellFolder
*)This
);
2104 static HRESULT WINAPI
ISVDropSource_QueryContinueDrag(
2106 BOOL fEscapePressed
,
2109 _ICOM_THIS_From_IDropSource(IShellViewImpl
, iface
);
2110 TRACE("(%p)\n",This
);
2113 return DRAGDROP_S_CANCEL
;
2114 else if (!(grfKeyState
& MK_LBUTTON
) && !(grfKeyState
& MK_RBUTTON
))
2115 return DRAGDROP_S_DROP
;
2120 static HRESULT WINAPI
ISVDropSource_GiveFeedback(
2124 _ICOM_THIS_From_IDropSource(IShellViewImpl
, iface
);
2125 TRACE("(%p)\n",This
);
2127 return DRAGDROP_S_USEDEFAULTCURSORS
;
2130 static struct ICOM_VTABLE(IDropSource
) dsvt
=
2132 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2133 ISVDropSource_QueryInterface
,
2134 ISVDropSource_AddRef
,
2135 ISVDropSource_Release
,
2136 ISVDropSource_QueryContinueDrag
,
2137 ISVDropSource_GiveFeedback
2139 /**********************************************************
2140 * ISVViewObject implementation
2143 static HRESULT WINAPI
ISVViewObject_QueryInterface(
2148 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2150 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,debugstr_guid(riid
),ppvObj
);
2152 return IShellFolder_QueryInterface((IShellFolder
*)This
, riid
, ppvObj
);
2155 static ULONG WINAPI
ISVViewObject_AddRef( IViewObject
*iface
)
2157 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2159 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
2161 return IShellFolder_AddRef((IShellFolder
*)This
);
2164 static ULONG WINAPI
ISVViewObject_Release( IViewObject
*iface
)
2166 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2168 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
2170 return IShellFolder_Release((IShellFolder
*)This
);
2173 static HRESULT WINAPI
ISVViewObject_Draw(
2178 DVTARGETDEVICE
* ptd
,
2181 LPCRECTL lprcBounds
,
2182 LPCRECTL lprcWBounds
,
2183 IVO_ContCallback pfnContinue
,
2187 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2189 FIXME("Stub: This=%p\n",This
);
2193 static HRESULT WINAPI
ISVViewObject_GetColorSet(
2198 DVTARGETDEVICE
* ptd
,
2199 HDC hicTargetDevice
,
2200 LOGPALETTE
** ppColorSet
)
2203 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2205 FIXME("Stub: This=%p\n",This
);
2209 static HRESULT WINAPI
ISVViewObject_Freeze(
2217 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2219 FIXME("Stub: This=%p\n",This
);
2223 static HRESULT WINAPI
ISVViewObject_Unfreeze(
2228 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2230 FIXME("Stub: This=%p\n",This
);
2234 static HRESULT WINAPI
ISVViewObject_SetAdvise(
2238 IAdviseSink
* pAdvSink
)
2241 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2243 FIXME("Stub: This=%p\n",This
);
2247 static HRESULT WINAPI
ISVViewObject_GetAdvise(
2251 IAdviseSink
** ppAdvSink
)
2254 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
2256 FIXME("Stub: This=%p\n",This
);
2262 static struct ICOM_VTABLE(IViewObject
) vovt
=
2264 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2265 ISVViewObject_QueryInterface
,
2266 ISVViewObject_AddRef
,
2267 ISVViewObject_Release
,
2269 ISVViewObject_GetColorSet
,
2270 ISVViewObject_Freeze
,
2271 ISVViewObject_Unfreeze
,
2272 ISVViewObject_SetAdvise
,
2273 ISVViewObject_GetAdvise