4 * Copyright 1998 <juergen.schmied@metronet.de>
6 * FIXME: when the ShellView_WndProc gets a WM_NCDESTROY should we do a
15 #include "wine/obj_base.h"
16 #include "wine/obj_shellfolder.h"
17 #include "wine/obj_shellview.h"
18 #include "wine/obj_commdlgbrowser.h"
19 #include "wine/obj_shellbrowser.h"
20 #include "wine/obj_dockingwindowframe.h"
21 #include "wine/obj_extracticon.h"
25 #include "debugtools.h"
30 #include "shell32_main.h"
32 DEFAULT_DEBUG_CHANNEL(shell
)
35 { ICOM_VTABLE(IShellView
)* lpvtbl
;
37 ICOM_VTABLE(IOleCommandTarget
)* lpvtblOleCommandTarget
;
38 ICOM_VTABLE(IDropTarget
)* lpvtblDropTarget
;
39 ICOM_VTABLE(IViewObject
)* lpvtblViewObject
;
40 IShellFolder
* pSFParent
;
41 IShellBrowser
* pShellBrowser
;
42 ICommDlgBrowser
* pCommDlgBrowser
;
46 FOLDERSETTINGS FolderSettings
;
53 static struct ICOM_VTABLE(IShellView
) svvt
;
55 static struct ICOM_VTABLE(IOleCommandTarget
) ctvt
;
56 #define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget)))
57 #define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset);
59 static struct ICOM_VTABLE(IDropTarget
) dtvt
;
60 #define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget)))
61 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
63 static struct ICOM_VTABLE(IViewObject
) vovt
;
64 #define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject)))
65 #define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset);
68 #define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
69 #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
70 #define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
72 #define ID_LISTVIEW 2000
74 #define TOOLBAR_ID (L"SHELLDLL_DefView")
76 #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
77 #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
78 #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
80 #define WM_SETTINGCHANGE WM_WININICHANGE
81 extern void WINAPI
_InsertMenuItem (HMENU hmenu
, UINT indexMenu
, BOOL fByPosition
,
82 UINT wID
, UINT fType
, LPSTR dwTypeData
, UINT fState
);
92 } MYTOOLINFO
, *LPMYTOOLINFO
;
95 MYTOOLINFO g_Tools
[] =
96 { {IDM_VIEW_FILES
, 0, IDS_TB_VIEW_FILES
, IDS_MI_VIEW_FILES
, 0, TBSTATE_ENABLED
, TBSTYLE_BUTTON
},
97 {-1, 0, 0, 0, 0, 0, 0}
103 typedef void (CALLBACK
*PFNSHGETSETTINGSPROC
)(LPSHELLFLAGSTATE lpsfs
, DWORD dwMask
);
105 /**********************************************************
106 * IShellView_Constructor
108 IShellView
* IShellView_Constructor( IShellFolder
* pFolder
)
109 { IShellViewImpl
* sv
;
110 sv
=(IShellViewImpl
*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IShellViewImpl
));
113 sv
->lpvtblOleCommandTarget
=&ctvt
;
114 sv
->lpvtblDropTarget
=&dtvt
;
115 sv
->lpvtblViewObject
=&vovt
;
117 sv
->pSFParent
= pFolder
;
120 IShellFolder_AddRef(pFolder
);
122 TRACE("(%p)->(%p)\n",sv
, pFolder
);
124 return (IShellView
*) sv
;
127 /**********************************************************
129 * ##### helperfunctions for communication with ICommDlgBrowser #####
131 static BOOL
IsInCommDlg(IShellViewImpl
* This
)
132 { return(This
->pCommDlgBrowser
!= NULL
);
135 static HRESULT
IncludeObject(IShellViewImpl
* This
, LPCITEMIDLIST pidl
)
139 if ( IsInCommDlg(This
) )
141 TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl
);
142 ret
= ICommDlgBrowser_IncludeObject(This
->pCommDlgBrowser
, (IShellView
*)This
, pidl
);
143 TRACE("--0x%08lx\n", ret
);
148 static HRESULT
OnDefaultCommand(IShellViewImpl
* This
)
150 HRESULT ret
= S_FALSE
;
152 if (IsInCommDlg(This
))
154 TRACE("ICommDlgBrowser::OnDefaultCommand\n");
155 ret
= ICommDlgBrowser_OnDefaultCommand(This
->pCommDlgBrowser
, (IShellView
*)This
);
161 static HRESULT
OnStateChange(IShellViewImpl
* This
, UINT uFlags
)
163 HRESULT ret
= S_FALSE
;
165 if (IsInCommDlg(This
))
167 TRACE("ICommDlgBrowser::OnStateChange flags=%x\n", uFlags
);
168 ret
= ICommDlgBrowser_OnStateChange(This
->pCommDlgBrowser
, (IShellView
*)This
, uFlags
);
173 /**********************************************************
175 * ##### helperfunctions for initializing the view #####
177 /**********************************************************
178 * set the toolbar buttons
180 static void CheckToolbar(IShellViewImpl
* This
)
186 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_CHECKBUTTON
,
187 FCIDM_TB_SMALLICON
, (This
->FolderSettings
.ViewMode
==FVM_LIST
)? TRUE
: FALSE
, &result
);
188 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_CHECKBUTTON
,
189 FCIDM_TB_REPORTVIEW
, (This
->FolderSettings
.ViewMode
==FVM_DETAILS
)? TRUE
: FALSE
, &result
);
190 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_ENABLEBUTTON
,
191 FCIDM_TB_SMALLICON
, TRUE
, &result
);
192 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_TOOLBAR
, TB_ENABLEBUTTON
,
193 FCIDM_TB_REPORTVIEW
, TRUE
, &result
);
196 /**********************************************************
197 * change the style of the listview control
200 static void SetStyle(IShellViewImpl
* This
, DWORD dwAdd
, DWORD dwRemove
)
204 TRACE("(%p)\n", This
);
206 tmpstyle
= GetWindowLongA(This
->hWndList
, GWL_STYLE
);
207 SetWindowLongA(This
->hWndList
, GWL_STYLE
, dwAdd
| (tmpstyle
& ~dwRemove
));
210 /**********************************************************
211 * ShellView_CreateList()
214 static BOOL
ShellView_CreateList (IShellViewImpl
* This
)
219 dwStyle
= WS_TABSTOP
| WS_VISIBLE
| WS_CHILD
| WS_BORDER
|
220 LVS_SHAREIMAGELISTS
| LVS_EDITLABELS
| LVS_ALIGNLEFT
| LVS_AUTOARRANGE
;
222 switch (This
->FolderSettings
.ViewMode
)
224 case FVM_ICON
: dwStyle
|= LVS_ICON
; break;
225 case FVM_DETAILS
: dwStyle
|= LVS_REPORT
; break;
226 case FVM_SMALLICON
: dwStyle
|= LVS_SMALLICON
; break;
227 case FVM_LIST
: dwStyle
|= LVS_LIST
; break;
228 default: dwStyle
|= LVS_LIST
; break;
231 if (This
->FolderSettings
.fFlags
&& FWF_AUTOARRANGE
) dwStyle
|= LVS_AUTOARRANGE
;
232 /*if (This->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/
233 if (This
->FolderSettings
.fFlags
&& FWF_SINGLESEL
) dwStyle
|= LVS_SINGLESEL
;
235 This
->hWndList
=CreateWindowExA( WS_EX_CLIENTEDGE
,
248 /* UpdateShellSettings(); */
251 /**********************************************************
252 * ShellView_InitList()
254 int nColumn1
=120; /* width of column */
259 static BOOL
ShellView_InitList(IShellViewImpl
* This
)
266 ListView_DeleteAllItems(This
->hWndList
);
268 /*initialize the columns */
269 lvColumn
.mask
= LVCF_FMT
| LVCF_WIDTH
| LVCF_TEXT
; /* | LVCF_SUBITEM;*/
270 lvColumn
.fmt
= LVCFMT_LEFT
;
271 lvColumn
.pszText
= szString
;
273 lvColumn
.cx
= nColumn1
;
274 strcpy(szString
,"File");
275 /*LoadStringA(shell32_hInstance, IDS_COLUMN1, szString, sizeof(szString));*/
276 ListView_InsertColumnA(This
->hWndList
, 0, &lvColumn
);
278 lvColumn
.cx
= nColumn2
;
279 strcpy(szString
,"Size");
280 ListView_InsertColumnA(This
->hWndList
, 1, &lvColumn
);
282 lvColumn
.cx
= nColumn3
;
283 strcpy(szString
,"Type");
284 ListView_InsertColumnA(This
->hWndList
, 2, &lvColumn
);
286 lvColumn
.cx
= nColumn4
;
287 strcpy(szString
,"Modified");
288 ListView_InsertColumnA(This
->hWndList
, 3, &lvColumn
);
290 ListView_SetImageList(This
->hWndList
, ShellSmallIconList
, LVSIL_SMALL
);
291 ListView_SetImageList(This
->hWndList
, ShellBigIconList
, LVSIL_NORMAL
);
295 /**********************************************************
296 * ShellView_CompareItems()
299 * internal, CALLBACK for DSA_Sort
301 static INT CALLBACK
ShellView_CompareItems(LPVOID lParam1
, LPVOID lParam2
, LPARAM lpData
)
304 TRACE("pidl1=%p pidl2=%p lpsf=%p\n", lParam1
, lParam2
, (LPVOID
) lpData
);
306 if(!lpData
) return 0;
308 ret
= (SHORT
) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER
)lpData
, 0, (LPITEMIDLIST
)lParam1
, (LPITEMIDLIST
)lParam2
));
309 TRACE("ret=%i\n",ret
);
313 /**********************************************************
314 * ShellView_FillList()
320 static HRESULT
ShellView_FillList(IShellViewImpl
* This
)
322 LPENUMIDLIST pEnumIDList
;
332 /* get the itemlist from the shfolder*/
333 hRes
= IShellFolder_EnumObjects(This
->pSFParent
,This
->hWnd
, SHCONTF_NONFOLDERS
| SHCONTF_FOLDERS
, &pEnumIDList
);
341 /* create a pointer array */
342 hdpa
= pDPA_Create(16);
345 return(E_OUTOFMEMORY
);
348 /* copy the items into the array*/
349 while((S_OK
== IEnumIDList_Next(pEnumIDList
,1, &pidl
, &dwFetched
)) && dwFetched
)
351 if (pDPA_InsertPtr(hdpa
, 0x7fff, pidl
) == -1)
358 pDPA_Sort(hdpa
, ShellView_CompareItems
, (LPARAM
)This
->pSFParent
);
360 /*turn the listview's redrawing off*/
361 SendMessageA(This
->hWndList
, WM_SETREDRAW
, FALSE
, 0);
363 for (i
=0; i
< DPA_GetPtrCount(hdpa
); ++i
) /* DPA_GetPtrCount is a macro*/
365 pidl
= (LPITEMIDLIST
)DPA_GetPtr(hdpa
, i
);
366 if (IncludeObject(This
, pidl
) == S_OK
) /* in a commdlg This works as a filemask*/
368 ZeroMemory(&lvItem
, sizeof(lvItem
)); /* create the listviewitem*/
369 lvItem
.mask
= LVIF_TEXT
| LVIF_IMAGE
| LVIF_PARAM
; /*set the mask*/
370 lvItem
.iItem
= ListView_GetItemCount(This
->hWndList
); /*add the item to the end of the list*/
371 lvItem
.lParam
= (LPARAM
) pidl
; /*set the item's data*/
372 lvItem
.pszText
= LPSTR_TEXTCALLBACKA
; /*get text on a callback basis*/
373 lvItem
.iImage
= I_IMAGECALLBACK
; /*get the image on a callback basis*/
374 ListView_InsertItemA(This
->hWndList
, &lvItem
);
377 SHFree(pidl
); /* the listview has the COPY*/
380 /*turn the listview's redrawing back on and force it to draw*/
381 SendMessageA(This
->hWndList
, WM_SETREDRAW
, TRUE
, 0);
382 InvalidateRect(This
->hWndList
, NULL
, TRUE
);
383 UpdateWindow(This
->hWndList
);
385 IEnumIDList_Release(pEnumIDList
); /* destroy the list*/
391 /**********************************************************
392 * ShellView_OnCreate()
394 static LRESULT
ShellView_OnCreate(IShellViewImpl
* This
)
398 if(ShellView_CreateList(This
))
400 if(ShellView_InitList(This
))
402 ShellView_FillList(This
);
408 /**********************************************************
409 * #### Handling of the menus ####
412 /**********************************************************
413 * ShellView_BuildFileMenu()
415 static HMENU
ShellView_BuildFileMenu(IShellViewImpl
* This
)
416 { CHAR szText
[MAX_PATH
];
421 TRACE("(%p) semi-stub\n",This
);
423 hSubMenu
= CreatePopupMenu();
425 { /*get the number of items in our global array*/
426 for(nTools
= 0; g_Tools
[nTools
].idCommand
!= -1; nTools
++){}
428 /*add the menu items*/
429 for(i
= 0; i
< nTools
; i
++)
430 { strcpy(szText
, "dummy BuildFileMenu");
432 ZeroMemory(&mii
, sizeof(mii
));
433 mii
.cbSize
= sizeof(mii
);
434 mii
.fMask
= MIIM_TYPE
| MIIM_ID
| MIIM_STATE
;
436 if(TBSTYLE_SEP
!= g_Tools
[i
].bStyle
) /* no seperator*/
437 { mii
.fType
= MFT_STRING
;
438 mii
.fState
= MFS_ENABLED
;
439 mii
.dwTypeData
= szText
;
440 mii
.wID
= g_Tools
[i
].idCommand
;
443 { mii
.fType
= MFT_SEPARATOR
;
445 /* tack This item onto the end of the menu */
446 InsertMenuItemA(hSubMenu
, (UINT
)-1, TRUE
, &mii
);
449 TRACE("-- return (menu=0x%x)\n",hSubMenu
);
452 /**********************************************************
453 * ShellView_MergeFileMenu()
455 static void ShellView_MergeFileMenu(IShellViewImpl
* This
, HMENU hSubMenu
)
456 { TRACE("(%p)->(submenu=0x%08x) stub\n",This
,hSubMenu
);
459 { /*insert This item at the beginning of the menu */
460 _InsertMenuItem(hSubMenu
, 0, TRUE
, 0, MFT_SEPARATOR
, NULL
, MFS_ENABLED
);
461 _InsertMenuItem(hSubMenu
, 0, TRUE
, IDM_MYFILEITEM
, MFT_STRING
, "dummy45", MFS_ENABLED
);
467 /**********************************************************
468 * ShellView_MergeViewMenu()
471 static void ShellView_MergeViewMenu(IShellViewImpl
* This
, HMENU hSubMenu
)
474 TRACE("(%p)->(submenu=0x%08x)\n",This
,hSubMenu
);
477 { /*add a separator at the correct position in the menu*/
478 _InsertMenuItem(hSubMenu
, FCIDM_MENU_VIEW_SEP_OPTIONS
, FALSE
, 0, MFT_SEPARATOR
, NULL
, MFS_ENABLED
);
480 ZeroMemory(&mii
, sizeof(mii
));
481 mii
.cbSize
= sizeof(mii
);
482 mii
.fMask
= MIIM_SUBMENU
| MIIM_TYPE
| MIIM_DATA
;;
483 mii
.fType
= MFT_STRING
;
484 mii
.dwTypeData
= "View";
485 mii
.hSubMenu
= LoadMenuA(shell32_hInstance
, "MENU_001");
486 InsertMenuItemA(hSubMenu
, FCIDM_MENU_VIEW_SEP_OPTIONS
, FALSE
, &mii
);
490 /**********************************************************
491 * ShellView_GetSelections()
494 * number of selected items
496 static UINT
ShellView_GetSelections(IShellViewImpl
* This
)
506 This
->cidl
= ListView_GetSelectedCount(This
->hWndList
);
507 This
->apidl
= (LPITEMIDLIST
*)SHAlloc(This
->cidl
* sizeof(LPITEMIDLIST
));
509 TRACE("selected=%i\n", This
->cidl
);
513 TRACE("-- Items selected =%u\n", This
->cidl
);
515 ZeroMemory(&lvItem
, sizeof(lvItem
));
516 lvItem
.mask
= LVIF_STATE
| LVIF_PARAM
;
517 lvItem
.stateMask
= LVIS_SELECTED
;
519 while(ListView_GetItemA(This
->hWndList
, &lvItem
) && (i
< This
->cidl
))
521 if(lvItem
.state
& LVIS_SELECTED
)
523 This
->apidl
[i
] = (LPITEMIDLIST
)lvItem
.lParam
;
525 TRACE("-- selected Item found\n");
533 /**********************************************************
534 * ShellView_DoContextMenu()
536 static void ShellView_DoContextMenu(IShellViewImpl
* This
, WORD x
, WORD y
, BOOL bDefault
)
540 BOOL fExplore
= FALSE
;
542 LPCONTEXTMENU pContextMenu
= NULL
;
543 IContextMenu
* pCM
= NULL
;
544 CMINVOKECOMMANDINFO cmi
;
546 TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This
, x
, y
, bDefault
);
548 /* look, what's selected and create a context menu object of it*/
549 if( ShellView_GetSelections(This
) )
551 IShellFolder_GetUIObjectOf( This
->pSFParent
, This
->hWndParent
, This
->cidl
, This
->apidl
,
552 (REFIID
)&IID_IContextMenu
, NULL
, (LPVOID
*)&pContextMenu
);
556 TRACE("-- pContextMenu\n");
557 hMenu
= CreatePopupMenu();
561 /* See if we are in Explore or Open mode. If the browser's tree is present, we are in Explore mode.*/
562 if(SUCCEEDED(IShellBrowser_GetControlWindow(This
->pShellBrowser
,FCW_TREE
, &hwndTree
)) && hwndTree
)
564 TRACE("-- explore mode\n");
568 /* build the flags depending on what we can do with the selected item */
569 wFlags
= CMF_NORMAL
| (This
->cidl
!= 1 ? 0 : CMF_CANRENAME
) | (fExplore
? CMF_EXPLORE
: 0);
571 /* let the ContextMenu merge its items in */
572 if (SUCCEEDED(IContextMenu_QueryContextMenu( pContextMenu
, hMenu
, 0, FCIDM_SHVIEWFIRST
, FCIDM_SHVIEWLAST
, wFlags
)))
576 TRACE("-- get menu default command\n");
577 uCommand
= GetMenuDefaultItem(hMenu
, FALSE
, GMDI_GOINTOPOPUPS
);
581 TRACE("-- track popup\n");
582 uCommand
= TrackPopupMenu( hMenu
,TPM_LEFTALIGN
| TPM_RETURNCMD
,x
,y
,0,This
->hWnd
,NULL
);
587 TRACE("-- uCommand=%u\n", uCommand
);
588 if (IsInCommDlg(This
) && ((uCommand
==IDM_EXPLORE
) || (uCommand
==IDM_OPEN
)))
590 TRACE("-- dlg: OnDefaultCommand\n");
591 OnDefaultCommand(This
);
595 TRACE("-- explore -- invoke command\n");
596 ZeroMemory(&cmi
, sizeof(cmi
));
597 cmi
.cbSize
= sizeof(cmi
);
598 cmi
.hwnd
= This
->hWndParent
;
599 cmi
.lpVerb
= (LPCSTR
)MAKEINTRESOURCEA(uCommand
);
600 IContextMenu_InvokeCommand(pContextMenu
, &cmi
);
607 IContextMenu_Release(pContextMenu
);
610 else /* background context menu */
612 hMenu
= CreatePopupMenu();
614 pCM
= ISvBgCm_Constructor();
615 IContextMenu_QueryContextMenu(pCM
, hMenu
, 0, FCIDM_SHVIEWFIRST
, FCIDM_SHVIEWLAST
, 0);
617 uCommand
= TrackPopupMenu( hMenu
, TPM_LEFTALIGN
| TPM_RETURNCMD
,x
,y
,0,This
->hWnd
,NULL
);
620 FIXME("-- (%p)->(uCommand=0x%08x )\n",This
, uCommand
);
622 ZeroMemory(&cmi
, sizeof(cmi
));
623 cmi
.cbSize
= sizeof(cmi
);
624 cmi
.lpVerb
= (LPCSTR
)MAKEINTRESOURCEA(uCommand
);
625 cmi
.hwnd
= This
->hWndParent
;
626 IContextMenu_InvokeCommand(pCM
, &cmi
);
628 IContextMenu_Release(pCM
);
632 /**********************************************************
633 * ##### message handling #####
636 /**********************************************************
639 static LRESULT
ShellView_OnSize(IShellViewImpl
* This
, WORD wWidth
, WORD wHeight
)
641 TRACE("%p width=%u height=%u\n",This
, wWidth
,wHeight
);
643 /*resize the ListView to fit our window*/
646 MoveWindow(This
->hWndList
, 0, 0, wWidth
, wHeight
, TRUE
);
651 /**********************************************************
652 * ShellView_OnDeactivate()
657 static void ShellView_OnDeactivate(IShellViewImpl
* This
)
661 if(This
->uState
!= SVUIA_DEACTIVATE
)
665 IShellBrowser_SetMenuSB(This
->pShellBrowser
,0, 0, 0);
666 IShellBrowser_RemoveMenusSB(This
->pShellBrowser
,This
->hMenu
);
667 DestroyMenu(This
->hMenu
);
671 This
->uState
= SVUIA_DEACTIVATE
;
675 /**********************************************************
676 * ShellView_OnActivate()
678 static LRESULT
ShellView_OnActivate(IShellViewImpl
* This
, UINT uState
)
679 { OLEMENUGROUPWIDTHS omw
= { {0, 0, 0, 0, 0, 0} };
681 CHAR szText
[MAX_PATH
];
683 TRACE("%p uState=%x\n",This
,uState
);
685 /*don't do anything if the state isn't really changing */
686 if(This
->uState
== uState
)
691 ShellView_OnDeactivate(This
);
693 /*only do This if we are active */
694 if(uState
!= SVUIA_DEACTIVATE
)
697 This
->hMenu
= CreateMenu();
701 IShellBrowser_InsertMenusSB(This
->pShellBrowser
, This
->hMenu
, &omw
);
702 TRACE("-- after fnInsertMenusSB\n");
704 /*build the top level menu get the menu item's text*/
705 strcpy(szText
,"dummy 31");
707 ZeroMemory(&mii
, sizeof(mii
));
708 mii
.cbSize
= sizeof(mii
);
709 mii
.fMask
= MIIM_SUBMENU
| MIIM_TYPE
| MIIM_STATE
;
710 mii
.fType
= MFT_STRING
;
711 mii
.fState
= MFS_ENABLED
;
712 mii
.dwTypeData
= szText
;
713 mii
.hSubMenu
= ShellView_BuildFileMenu(This
);
715 /*insert our menu into the menu bar*/
718 InsertMenuItemA(This
->hMenu
, FCIDM_MENU_HELP
, FALSE
, &mii
);
721 /*get the view menu so we can merge with it*/
722 ZeroMemory(&mii
, sizeof(mii
));
723 mii
.cbSize
= sizeof(mii
);
724 mii
.fMask
= MIIM_SUBMENU
;
726 if(GetMenuItemInfoA(This
->hMenu
, FCIDM_MENU_VIEW
, FALSE
, &mii
))
728 ShellView_MergeViewMenu(This
, mii
.hSubMenu
);
731 /*add the items that should only be added if we have the focus*/
732 if(SVUIA_ACTIVATE_FOCUS
== uState
)
734 /*get the file menu so we can merge with it */
735 ZeroMemory(&mii
, sizeof(mii
));
736 mii
.cbSize
= sizeof(mii
);
737 mii
.fMask
= MIIM_SUBMENU
;
739 if(GetMenuItemInfoA(This
->hMenu
, FCIDM_MENU_FILE
, FALSE
, &mii
))
741 ShellView_MergeFileMenu(This
, mii
.hSubMenu
);
744 TRACE("-- before fnSetMenuSB\n");
745 IShellBrowser_SetMenuSB(This
->pShellBrowser
, This
->hMenu
, 0, This
->hWnd
);
748 This
->uState
= uState
;
753 /**********************************************************
754 * ShellView_OnSetFocus()
757 static LRESULT
ShellView_OnSetFocus(IShellViewImpl
* This
)
761 /* Tell the browser one of our windows has received the focus. This
762 should always be done before merging menus (OnActivate merges the
763 menus) if one of our windows has the focus.*/
765 IShellBrowser_OnViewWindowActive(This
->pShellBrowser
,(IShellView
*) This
);
766 ShellView_OnActivate(This
, SVUIA_ACTIVATE_FOCUS
);
771 /**********************************************************
772 * ShellView_OnKillFocus()
774 static LRESULT
ShellView_OnKillFocus(IShellViewImpl
* This
)
776 TRACE("(%p) stub\n",This
);
778 ShellView_OnActivate(This
, SVUIA_ACTIVATE_NOFOCUS
);
783 /**********************************************************
784 * ShellView_OnCommand()
786 static LRESULT
ShellView_OnCommand(IShellViewImpl
* This
,DWORD dwCmdID
, DWORD dwCmd
, HWND hwndCmd
)
788 TRACE("(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",This
, dwCmdID
, dwCmd
, hwndCmd
);
792 case FCIDM_SHVIEW_SMALLICON
:
793 This
->FolderSettings
.ViewMode
= FVM_SMALLICON
;
794 SetStyle (This
, LVS_SMALLICON
, LVS_TYPEMASK
);
797 case FCIDM_SHVIEW_BIGICON
:
798 This
->FolderSettings
.ViewMode
= FVM_ICON
;
799 SetStyle (This
, LVS_ICON
, LVS_TYPEMASK
);
802 case FCIDM_SHVIEW_LISTVIEW
:
803 This
->FolderSettings
.ViewMode
= FVM_LIST
;
804 SetStyle (This
, LVS_LIST
, LVS_TYPEMASK
);
807 case FCIDM_SHVIEW_REPORTVIEW
:
808 This
->FolderSettings
.ViewMode
= FVM_DETAILS
;
809 SetStyle (This
, LVS_REPORT
, LVS_TYPEMASK
);
813 TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID
);
818 /**********************************************************
819 * ShellView_OnNotify()
822 static LRESULT
ShellView_OnNotify(IShellViewImpl
* This
, UINT CtlID
, LPNMHDR lpnmh
)
823 { NM_LISTVIEW
*lpnmlv
= (NM_LISTVIEW
*)lpnmh
;
824 NMLVDISPINFOA
*lpdi
= (NMLVDISPINFOA
*)lpnmh
;
829 TRACE("%p CtlID=%u lpnmh->code=%x\n",This
,CtlID
,lpnmh
->code
);
834 TRACE("-- NM_SETFOCUS %p\n",This
);
835 ShellView_OnSetFocus(This
);
839 TRACE("-- NM_KILLFOCUS %p\n",This
);
840 ShellView_OnDeactivate(This
);
844 TRACE("-- HDN_ENDTRACKA %p\n",This
);
845 /*nColumn1 = ListView_GetColumnWidth(This->hWndList, 0);
846 nColumn2 = ListView_GetColumnWidth(This->hWndList, 1);*/
850 TRACE("-- LVN_DELETEITEM %p\n",This
);
851 SHFree((LPITEMIDLIST
)lpnmlv
->lParam
); /*delete the pidl because we made a copy of it*/
854 case LVN_ITEMACTIVATE
:
855 TRACE("-- LVN_ITEMACTIVATE %p\n",This
);
856 OnStateChange(This
, CDBOSC_SELCHANGE
); /* the browser will get the IDataObject now */
857 ShellView_DoContextMenu(This
, 0, 0, TRUE
);
861 TRACE("-- NM_RCLICK %p\n",This
);
862 dwCursor
= GetMessagePos();
863 ShellView_DoContextMenu(This
, LOWORD(dwCursor
), HIWORD(dwCursor
), FALSE
);
866 case LVN_GETDISPINFOA
:
867 TRACE("-- LVN_GETDISPINFOA %p\n",This
);
868 pidl
= (LPITEMIDLIST
)lpdi
->item
.lParam
;
871 if(lpdi
->item
.iSubItem
) /*is the sub-item information being requested?*/
872 { if(lpdi
->item
.mask
& LVIF_TEXT
) /*is the text being requested?*/
873 { if(_ILIsValue(pidl
)) /*is This a value or a folder?*/
874 { switch (lpdi
->item
.iSubItem
)
876 _ILGetFileSize (pidl
, lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
);
878 case 2: /* extension */
880 if (_ILGetExtension (pidl
, sTemp
, 64))
881 { if (!( HCR_MapTypeToValue(sTemp
, sTemp
, 64)
882 && HCR_MapTypeToValue(sTemp
, lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
)))
883 { lstrcpynA (lpdi
->item
.pszText
, sTemp
, lpdi
->item
.cchTextMax
);
884 strncat (lpdi
->item
.pszText
, "-file", lpdi
->item
.cchTextMax
);
887 else /* no extension found */
888 { lpdi
->item
.pszText
[0]=0x00;
893 _ILGetFileDate (pidl
, lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
);
897 else /*its a folder*/
898 { switch (lpdi
->item
.iSubItem
)
900 strcpy(lpdi
->item
.pszText
, "");
903 lstrcpynA (lpdi
->item
.pszText
, "Folder", lpdi
->item
.cchTextMax
);
906 _ILGetFileDate (pidl
, lpdi
->item
.pszText
, lpdi
->item
.cchTextMax
);
910 TRACE("-- text=%s\n",lpdi
->item
.pszText
);
913 else /*the item text is being requested*/
914 { if(lpdi
->item
.mask
& LVIF_TEXT
) /*is the text being requested?*/
915 { if(SUCCEEDED(IShellFolder_GetDisplayNameOf(This
->pSFParent
,pidl
, SHGDN_NORMAL
| SHGDN_INFOLDER
, &str
)))
916 { if(STRRET_WSTR
== str
.uType
)
917 { WideCharToLocal(lpdi
->item
.pszText
, str
.u
.pOleStr
, lpdi
->item
.cchTextMax
);
918 SHFree(str
.u
.pOleStr
);
920 else if(STRRET_CSTRA
== str
.uType
)
921 { lstrcpynA(lpdi
->item
.pszText
, str
.u
.cStr
, lpdi
->item
.cchTextMax
);
924 { FIXME("type wrong\n");
927 TRACE("-- text=%s\n",lpdi
->item
.pszText
);
930 if(lpdi
->item
.mask
& LVIF_IMAGE
) /*is the image being requested?*/
931 { lpdi
->item
.iImage
= SHMapPIDLToSystemImageListIndex(This
->pSFParent
, pidl
, 0);
936 case LVN_ITEMCHANGED
:
937 TRACE("-- LVN_ITEMCHANGED %p\n",This
);
938 /* ShellView_GetSelections(This); */
939 OnStateChange(This
, CDBOSC_SELCHANGE
); /* the browser will get the IDataObject now */
943 TRACE("-- %p WM_COMMAND %s unhandled\n", This
, SPY_GetMsgName(lpnmh
->code
));
949 /**********************************************************
953 static LRESULT CALLBACK
ShellView_WndProc(HWND hWnd
, UINT uMessage
, WPARAM wParam
, LPARAM lParam
)
955 IShellViewImpl
* pThis
= (IShellViewImpl
*)GetWindowLongA(hWnd
, GWL_USERDATA
);
956 LPCREATESTRUCTA lpcs
;
959 TRACE("(hwnd=%x msg=%x wparm=%x lparm=%lx)\n",hWnd
, uMessage
, wParam
, lParam
);
964 lpcs
= (LPCREATESTRUCTA
)lParam
;
965 pThis
= (IShellViewImpl
*)(lpcs
->lpCreateParams
);
966 SetWindowLongA(hWnd
, GWL_USERDATA
, (LONG
)pThis
);
967 pThis
->hWnd
= hWnd
; /*set the window handle*/
970 case WM_SIZE
: return ShellView_OnSize(pThis
,LOWORD(lParam
), HIWORD(lParam
));
971 case WM_SETFOCUS
: return ShellView_OnSetFocus(pThis
);
972 case WM_KILLFOCUS
: return ShellView_OnKillFocus(pThis
);
973 case WM_CREATE
: return ShellView_OnCreate(pThis
);
974 case WM_ACTIVATE
: return ShellView_OnActivate(pThis
, SVUIA_ACTIVATE_FOCUS
);
975 case WM_NOTIFY
: return ShellView_OnNotify(pThis
,(UINT
)wParam
, (LPNMHDR
)lParam
);
976 case WM_COMMAND
: return ShellView_OnCommand(pThis
,
977 GET_WM_COMMAND_ID(wParam
, lParam
),
978 GET_WM_COMMAND_CMD(wParam
, lParam
),
979 GET_WM_COMMAND_HWND(wParam
, lParam
));
981 case WM_SHOWWINDOW
: UpdateWindow(pThis
->hWndList
);
984 case WM_PARENTNOTIFY
:
985 /* fixme: should not be handled here*/
986 TRACE("-- WM_PARENTNOTIFY\n");
987 if ( LOWORD(wParam
) == WM_RBUTTONDOWN
)
989 dwCursor
= GetMessagePos();
990 ShellView_DoContextMenu(pThis
, LOWORD(dwCursor
), HIWORD(dwCursor
), FALSE
);
996 TRACE("-- message %s unhandled\n", SPY_GetMsgName(uMessage
));
1000 return DefWindowProcA (hWnd
, uMessage
, wParam
, lParam
);
1002 /**********************************************************
1005 * The INTERFACE of the IShellView object
1008 **********************************************************
1009 * IShellView_QueryInterface
1011 static HRESULT WINAPI
IShellView_fnQueryInterface(IShellView
* iface
,REFIID riid
, LPVOID
*ppvObj
)
1013 ICOM_THIS(IShellViewImpl
, iface
);
1016 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
1017 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,xriid
,ppvObj
);
1021 if(IsEqualIID(riid
, &IID_IUnknown
))
1025 else if(IsEqualIID(riid
, &IID_IShellView
))
1027 *ppvObj
= (IShellView
*)This
;
1029 else if(IsEqualIID(riid
, &IID_IOleCommandTarget
))
1031 *ppvObj
= (IOleCommandTarget
*)&(This
->lpvtblOleCommandTarget
);
1033 else if(IsEqualIID(riid
, &IID_IDropTarget
))
1035 *ppvObj
= (IDropTarget
*)&(This
->lpvtblDropTarget
);
1037 else if(IsEqualIID(riid
, &IID_IViewObject
))
1039 *ppvObj
= (IViewObject
*)&(This
->lpvtblViewObject
);
1044 IUnknown_AddRef( (IUnknown
*)*ppvObj
);
1045 TRACE("-- Interface: (%p)->(%p)\n",ppvObj
,*ppvObj
);
1048 TRACE("-- Interface: E_NOINTERFACE\n");
1049 return E_NOINTERFACE
;
1052 /**********************************************************
1055 static ULONG WINAPI
IShellView_fnAddRef(IShellView
* iface
)
1057 ICOM_THIS(IShellViewImpl
, iface
);
1059 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1062 return ++(This
->ref
);
1064 /**********************************************************
1065 * IShellView_Release
1067 static ULONG WINAPI
IShellView_fnRelease(IShellView
* iface
)
1069 ICOM_THIS(IShellViewImpl
, iface
);
1071 TRACE("(%p)->()\n",This
);
1077 TRACE(" destroying IShellView(%p)\n",This
);
1080 IShellFolder_Release(This
->pSFParent
);
1083 SHFree(This
->apidl
);
1085 if (This
->pCommDlgBrowser
)
1086 ICommDlgBrowser_Release(This
->pCommDlgBrowser
);
1088 HeapFree(GetProcessHeap(),0,This
);
1094 /**********************************************************
1095 * ShellView_GetWindow
1097 static HRESULT WINAPI
IShellView_fnGetWindow(IShellView
* iface
,HWND
* phWnd
)
1099 ICOM_THIS(IShellViewImpl
, iface
);
1101 TRACE("(%p)\n",This
);
1103 *phWnd
= This
->hWnd
;
1108 static HRESULT WINAPI
IShellView_fnContextSensitiveHelp(IShellView
* iface
,BOOL fEnterMode
)
1110 ICOM_THIS(IShellViewImpl
, iface
);
1112 FIXME("(%p) stub\n",This
);
1117 /**********************************************************
1118 * IShellView_TranslateAccelerator
1121 * use the accel functions
1123 static HRESULT WINAPI
IShellView_fnTranslateAccelerator(IShellView
* iface
,LPMSG lpmsg
)
1125 ICOM_THIS(IShellViewImpl
, iface
);
1127 FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This
,lpmsg
, lpmsg
->hwnd
, lpmsg
->message
, lpmsg
->lParam
, lpmsg
->wParam
);
1130 switch (lpmsg
->message
)
1131 { case WM_KEYDOWN
: TRACE("-- key=0x04%x",lpmsg
->wParam
) ;
1136 static HRESULT WINAPI
IShellView_fnEnableModeless(IShellView
* iface
,BOOL fEnable
)
1138 ICOM_THIS(IShellViewImpl
, iface
);
1140 FIXME("(%p) stub\n",This
);
1145 static HRESULT WINAPI
IShellView_fnUIActivate(IShellView
* iface
,UINT uState
)
1147 ICOM_THIS(IShellViewImpl
, iface
);
1149 CHAR szName
[MAX_PATH
];
1151 int nPartArray
[1] = {-1};
1153 TRACE("(%p)->(state=%x) stub\n",This
, uState
);
1155 /*don't do anything if the state isn't really changing*/
1156 if(This
->uState
== uState
)
1161 /*OnActivate handles the menu merging and internal state*/
1162 ShellView_OnActivate(This
, uState
);
1164 /*only do This if we are active*/
1165 if(uState
!= SVUIA_DEACTIVATE
)
1168 IShellFolder_GetFolderPath( This
->pSFParent
, szName
, sizeof(szName
) );
1170 /* set the number of parts */
1171 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_STATUS
, SB_SETPARTS
, 1,
1172 (LPARAM
)nPartArray
, &lResult
);
1174 /* set the text for the parts */
1175 IShellBrowser_SendControlMsg(This
->pShellBrowser
, FCW_STATUS
, SB_SETTEXTA
,
1176 0, (LPARAM
)szName
, &lResult
);
1182 static HRESULT WINAPI
IShellView_fnRefresh(IShellView
* iface
)
1184 ICOM_THIS(IShellViewImpl
, iface
);
1186 TRACE("(%p)\n",This
);
1188 ListView_DeleteAllItems(This
->hWndList
);
1189 ShellView_FillList(This
);
1194 static HRESULT WINAPI
IShellView_fnCreateViewWindow(
1196 IShellView
*lpPrevView
,
1197 LPCFOLDERSETTINGS lpfs
,
1198 IShellBrowser
* psb
,
1202 ICOM_THIS(IShellViewImpl
, iface
);
1208 TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This
, lpPrevView
,lpfs
, psb
, prcView
, phWnd
);
1209 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
);
1211 /*set up the member variables*/
1212 This
->pShellBrowser
= psb
;
1213 This
->FolderSettings
= *lpfs
;
1215 /*get our parent window*/
1216 IShellBrowser_AddRef(This
->pShellBrowser
);
1217 IShellBrowser_GetWindow(This
->pShellBrowser
, &(This
->hWndParent
));
1219 /* try to get the ICommDlgBrowserInterface, adds a reference !!! */
1220 This
->pCommDlgBrowser
=NULL
;
1221 if ( SUCCEEDED (IShellBrowser_QueryInterface( This
->pShellBrowser
,
1222 (REFIID
)&IID_ICommDlgBrowser
, (LPVOID
*) &This
->pCommDlgBrowser
)))
1224 TRACE("-- CommDlgBrowser\n");
1227 /*if our window class has not been registered, then do so*/
1228 if(!GetClassInfoA(shell32_hInstance
, SV_CLASS_NAME
, &wc
))
1230 ZeroMemory(&wc
, sizeof(wc
));
1231 wc
.style
= CS_HREDRAW
| CS_VREDRAW
;
1232 wc
.lpfnWndProc
= (WNDPROC
) ShellView_WndProc
;
1235 wc
.hInstance
= shell32_hInstance
;
1237 wc
.hCursor
= LoadCursorA (0, IDC_ARROWA
);
1238 wc
.hbrBackground
= (HBRUSH
) (COLOR_WINDOW
+ 1);
1239 wc
.lpszMenuName
= NULL
;
1240 wc
.lpszClassName
= SV_CLASS_NAME
;
1242 if(!RegisterClassA(&wc
))
1246 *phWnd
= CreateWindowExA(0,
1249 WS_CHILD
| WS_VISIBLE
| WS_CLIPSIBLINGS
,
1252 prcView
->right
- prcView
->left
,
1253 prcView
->bottom
- prcView
->top
,
1267 static HRESULT WINAPI
IShellView_fnDestroyViewWindow(IShellView
* iface
)
1269 ICOM_THIS(IShellViewImpl
, iface
);
1271 TRACE("(%p)\n",This
);
1273 /*Make absolutely sure all our UI is cleaned up.*/
1274 IShellView_UIActivate((IShellView
*)This
, SVUIA_DEACTIVATE
);
1278 DestroyMenu(This
->hMenu
);
1281 DestroyWindow(This
->hWnd
);
1282 IShellBrowser_Release(This
->pShellBrowser
);
1287 static HRESULT WINAPI
IShellView_fnGetCurrentInfo(IShellView
* iface
, LPFOLDERSETTINGS lpfs
)
1289 ICOM_THIS(IShellViewImpl
, iface
);
1291 TRACE("(%p)->(%p) vmode=%x flags=%x\n",This
, lpfs
,
1292 This
->FolderSettings
.ViewMode
, This
->FolderSettings
.fFlags
);
1294 if (!lpfs
) return E_INVALIDARG
;
1296 *lpfs
= This
->FolderSettings
;
1300 static HRESULT WINAPI
IShellView_fnAddPropertySheetPages(IShellView
* iface
, DWORD dwReserved
,LPFNADDPROPSHEETPAGE lpfn
, LPARAM lparam
)
1302 ICOM_THIS(IShellViewImpl
, iface
);
1304 FIXME("(%p) stub\n",This
);
1309 static HRESULT WINAPI
IShellView_fnSaveViewState(IShellView
* iface
)
1311 ICOM_THIS(IShellViewImpl
, iface
);
1313 FIXME("(%p) stub\n",This
);
1318 static HRESULT WINAPI
IShellView_fnSelectItem(IShellView
* iface
, LPCITEMIDLIST pidlItem
, UINT uFlags
)
1319 { ICOM_THIS(IShellViewImpl
, iface
);
1321 FIXME("(%p)->(pidl=%p, 0x%08x) stub\n",This
, pidlItem
, uFlags
);
1326 static HRESULT WINAPI
IShellView_fnGetItemObject(IShellView
* iface
, UINT uItem
, REFIID riid
, LPVOID
*ppvOut
)
1328 ICOM_THIS(IShellViewImpl
, iface
);
1332 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
1333 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This
, uItem
, xriid
, ppvOut
);
1339 case SVGIO_BACKGROUND
:
1340 *ppvOut
= ISvBgCm_Constructor();
1343 case SVGIO_SELECTION
:
1344 ShellView_GetSelections(This
);
1345 IShellFolder_GetUIObjectOf(This
->pSFParent
, This
->hWnd
, This
->cidl
, This
->apidl
, riid
, 0, ppvOut
);
1348 TRACE("-- (%p)->(interface=%p)\n",This
, *ppvOut
);
1350 if(!*ppvOut
) return E_OUTOFMEMORY
;
1355 static struct ICOM_VTABLE(IShellView
) svvt
=
1357 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1358 IShellView_fnQueryInterface
,
1359 IShellView_fnAddRef
,
1360 IShellView_fnRelease
,
1361 IShellView_fnGetWindow
,
1362 IShellView_fnContextSensitiveHelp
,
1363 IShellView_fnTranslateAccelerator
,
1364 IShellView_fnEnableModeless
,
1365 IShellView_fnUIActivate
,
1366 IShellView_fnRefresh
,
1367 IShellView_fnCreateViewWindow
,
1368 IShellView_fnDestroyViewWindow
,
1369 IShellView_fnGetCurrentInfo
,
1370 IShellView_fnAddPropertySheetPages
,
1371 IShellView_fnSaveViewState
,
1372 IShellView_fnSelectItem
,
1373 IShellView_fnGetItemObject
1377 /**********************************************************
1378 * ISVOleCmdTarget_QueryInterface (IUnknown)
1380 static HRESULT WINAPI
ISVOleCmdTarget_QueryInterface(
1381 IOleCommandTarget
* iface
,
1385 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1387 return IShellFolder_QueryInterface((IShellFolder
*)This
, iid
, ppvObj
);
1390 /**********************************************************
1391 * ISVOleCmdTarget_AddRef (IUnknown)
1393 static ULONG WINAPI
ISVOleCmdTarget_AddRef(
1394 IOleCommandTarget
* iface
)
1396 _ICOM_THIS_From_IOleCommandTarget(IShellFolder
, iface
);
1398 return IShellFolder_AddRef((IShellFolder
*)This
);
1401 /**********************************************************
1402 * ISVOleCmdTarget_Release (IUnknown)
1404 static ULONG WINAPI
ISVOleCmdTarget_Release(
1405 IOleCommandTarget
* iface
)
1407 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1409 return IShellFolder_Release((IShellFolder
*)This
);
1412 /**********************************************************
1413 * ISVOleCmdTarget_QueryStatus (IOleCommandTarget)
1415 static HRESULT WINAPI
ISVOleCmdTarget_QueryStatus(
1416 IOleCommandTarget
*iface
,
1417 const GUID
* pguidCmdGroup
,
1420 OLECMDTEXT
* pCmdText
)
1424 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1426 WINE_StringFromCLSID((LPCLSID
)pguidCmdGroup
,xguid
);
1428 FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n", This
, pguidCmdGroup
, xguid
, cCmds
, prgCmds
, pCmdText
);
1432 /**********************************************************
1433 * ISVOleCmdTarget_Exec (IOleCommandTarget)
1435 * nCmdID is the OLECMDID_* enumeration
1437 static HRESULT WINAPI
ISVOleCmdTarget_Exec(
1438 IOleCommandTarget
*iface
,
1439 const GUID
* pguidCmdGroup
,
1447 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl
, iface
);
1449 WINE_StringFromCLSID((LPCLSID
)pguidCmdGroup
,xguid
);
1451 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n", This
, xguid
, nCmdID
, nCmdexecopt
, pvaIn
, pvaOut
);
1455 static ICOM_VTABLE(IOleCommandTarget
) ctvt
=
1457 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1458 ISVOleCmdTarget_QueryInterface
,
1459 ISVOleCmdTarget_AddRef
,
1460 ISVOleCmdTarget_Release
,
1461 ISVOleCmdTarget_QueryStatus
,
1462 ISVOleCmdTarget_Exec
1465 /**********************************************************
1466 * ISVDropTarget implementation
1469 static HRESULT WINAPI
ISVDropTarget_QueryInterface(
1476 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1478 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
1480 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,xriid
,ppvObj
);
1482 return IShellFolder_QueryInterface((IShellFolder
*)This
, riid
, ppvObj
);
1485 static ULONG WINAPI
ISVDropTarget_AddRef( IDropTarget
*iface
)
1487 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1489 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1491 return IShellFolder_AddRef((IShellFolder
*)This
);
1494 static ULONG WINAPI
ISVDropTarget_Release( IDropTarget
*iface
)
1496 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1498 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1500 return IShellFolder_Release((IShellFolder
*)This
);
1503 static HRESULT WINAPI
ISVDropTarget_DragEnter(
1505 IDataObject
*pDataObject
,
1511 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1513 FIXME("Stub: This=%p, DataObject=%p\n",This
,pDataObject
);
1518 static HRESULT WINAPI
ISVDropTarget_DragOver(
1524 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1526 FIXME("Stub: This=%p\n",This
);
1531 static HRESULT WINAPI
ISVDropTarget_DragLeave(
1534 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1536 FIXME("Stub: This=%p\n",This
);
1541 static HRESULT WINAPI
ISVDropTarget_Drop(
1543 IDataObject
* pDataObject
,
1548 _ICOM_THIS_From_IDropTarget(IShellViewImpl
, iface
);
1550 FIXME("Stub: This=%p\n",This
);
1555 static struct ICOM_VTABLE(IDropTarget
) dtvt
=
1557 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1558 ISVDropTarget_QueryInterface
,
1559 ISVDropTarget_AddRef
,
1560 ISVDropTarget_Release
,
1561 ISVDropTarget_DragEnter
,
1562 ISVDropTarget_DragOver
,
1563 ISVDropTarget_DragLeave
,
1567 /**********************************************************
1568 * ISVViewObject implementation
1571 static HRESULT WINAPI
ISVViewObject_QueryInterface(
1578 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1580 WINE_StringFromCLSID((LPCLSID
)riid
,xriid
);
1582 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This
,xriid
,ppvObj
);
1584 return IShellFolder_QueryInterface((IShellFolder
*)This
, riid
, ppvObj
);
1587 static ULONG WINAPI
ISVViewObject_AddRef( IViewObject
*iface
)
1589 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1591 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1593 return IShellFolder_AddRef((IShellFolder
*)This
);
1596 static ULONG WINAPI
ISVViewObject_Release( IViewObject
*iface
)
1598 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1600 TRACE("(%p)->(count=%lu)\n",This
,This
->ref
);
1602 return IShellFolder_Release((IShellFolder
*)This
);
1605 static HRESULT WINAPI
ISVViewObject_Draw(
1610 DVTARGETDEVICE
* ptd
,
1613 LPCRECTL lprcBounds
,
1614 LPCRECTL lprcWBounds
,
1615 IVO_ContCallback pfnContinue
,
1619 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1621 FIXME("Stub: This=%p\n",This
);
1625 static HRESULT WINAPI
ISVViewObject_GetColorSet(
1630 DVTARGETDEVICE
* ptd
,
1631 HDC hicTargetDevice
,
1632 LOGPALETTE
** ppColorSet
)
1635 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1637 FIXME("Stub: This=%p\n",This
);
1641 static HRESULT WINAPI
ISVViewObject_Freeze(
1649 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1651 FIXME("Stub: This=%p\n",This
);
1655 static HRESULT WINAPI
ISVViewObject_Unfreeze(
1660 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1662 FIXME("Stub: This=%p\n",This
);
1666 static HRESULT WINAPI
ISVViewObject_SetAdvise(
1670 IAdviseSink
* pAdvSink
)
1673 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1675 FIXME("Stub: This=%p\n",This
);
1679 static HRESULT WINAPI
ISVViewObject_GetAdvise(
1683 IAdviseSink
** ppAdvSink
)
1686 _ICOM_THIS_From_IViewObject(IShellViewImpl
, iface
);
1688 FIXME("Stub: This=%p\n",This
);
1694 static struct ICOM_VTABLE(IViewObject
) vovt
=
1696 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1697 ISVViewObject_QueryInterface
,
1698 ISVViewObject_AddRef
,
1699 ISVViewObject_Release
,
1701 ISVViewObject_GetColorSet
,
1702 ISVViewObject_Freeze
,
1703 ISVViewObject_Unfreeze
,
1704 ISVViewObject_SetAdvise
,
1705 ISVViewObject_GetAdvise