Made the buttons in the filedlg change when selecting a different
[wine.git] / dlls / shell32 / shlview.c
blobb73a004d50ce2bfe5feef1b6ab9f5b02023d42f2
1 /*
2 * ShellView
4 * Copyright 1998,1999 <juergen.schmied@debitel.net>
6 * FIXME: when the ShellView_WndProc gets a WM_NCDESTROY should we do a
7 * Release() ???
9 * FIXME: There is still a design problem in this implementation.
10 * This implementation is more or less ok for file system folders
11 * but there are many more kinds of folders.
12 * The shellview is not supposed to know much about the colums
13 * appearing in the view. To fix this it should use the IShellFolder2
14 * interface when possible to get the informations dynamically
15 * this will take a lot of work to implemet and wont likely not
16 * be done in near future
17 * Please considder this when code new features. Mail me if you
18 * are in doubt how to do things. (jsch 25/10/99)
20 * FIXME: Set the buttons in the filedialog according to the view state
23 #include <stdlib.h>
24 #include <string.h>
26 #include "servprov.h"
27 #include "wine/obj_base.h"
28 #include "wine/obj_shellfolder.h"
29 #include "wine/obj_shellview.h"
30 #include "wine/obj_oleview.h"
31 #include "wine/obj_commdlgbrowser.h"
32 #include "wine/obj_shellbrowser.h"
33 #include "wine/obj_dockingwindowframe.h"
34 #include "wine/obj_extracticon.h"
35 #include "wine/obj_dragdrop.h"
36 #include "wine/undocshell.h"
37 #include "shresdef.h"
38 #include "spy.h"
39 #include "debugtools.h"
40 #include "winerror.h"
42 #include "docobj.h"
43 #include "pidl.h"
44 #include "shell32_main.h"
46 DEFAULT_DEBUG_CHANNEL(shell)
48 typedef struct
49 { BOOL bIsAscending;
50 INT nHeaderID;
51 INT nLastHeaderID;
52 }LISTVIEW_SORT_INFO, *LPLISTVIEW_SORT_INFO;
54 typedef struct
55 { ICOM_VFIELD(IShellView);
56 DWORD ref;
57 ICOM_VTABLE(IOleCommandTarget)* lpvtblOleCommandTarget;
58 ICOM_VTABLE(IDropTarget)* lpvtblDropTarget;
59 ICOM_VTABLE(IDropSource)* lpvtblDropSource;
60 ICOM_VTABLE(IViewObject)* lpvtblViewObject;
61 IShellFolder* pSFParent;
62 IShellBrowser* pShellBrowser;
63 ICommDlgBrowser* pCommDlgBrowser;
64 HWND hWnd;
65 HWND hWndList;
66 HWND hWndParent;
67 FOLDERSETTINGS FolderSettings;
68 HMENU hMenu;
69 UINT uState;
70 UINT cidl;
71 LPITEMIDLIST *apidl;
72 LISTVIEW_SORT_INFO ListViewSortInfo;
73 } IShellViewImpl;
75 static struct ICOM_VTABLE(IShellView) svvt;
77 static struct ICOM_VTABLE(IOleCommandTarget) ctvt;
78 #define _IOleCommandTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblOleCommandTarget)))
79 #define _ICOM_THIS_From_IOleCommandTarget(class, name) class* This = (class*)(((char*)name)-_IOleCommandTarget_Offset);
81 static struct ICOM_VTABLE(IDropTarget) dtvt;
82 #define _IDropTarget_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropTarget)))
83 #define _ICOM_THIS_From_IDropTarget(class, name) class* This = (class*)(((char*)name)-_IDropTarget_Offset);
85 static struct ICOM_VTABLE(IDropSource) dsvt;
86 #define _IDropSource_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblDropSource)))
87 #define _ICOM_THIS_From_IDropSource(class, name) class* This = (class*)(((char*)name)-_IDropSource_Offset);
89 static struct ICOM_VTABLE(IViewObject) vovt;
90 #define _IViewObject_Offset ((int)(&(((IShellViewImpl*)0)->lpvtblViewObject)))
91 #define _ICOM_THIS_From_IViewObject(class, name) class* This = (class*)(((char*)name)-_IViewObject_Offset);
93 /* ListView Header ID's */
94 #define LISTVIEW_COLUMN_NAME 0
95 #define LISTVIEW_COLUMN_SIZE 1
96 #define LISTVIEW_COLUMN_TYPE 2
97 #define LISTVIEW_COLUMN_TIME 3
98 #define LISTVIEW_COLUMN_ATTRIB 4
100 /*menu items */
101 #define IDM_VIEW_FILES (FCIDM_SHVIEWFIRST + 0x500)
102 #define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
103 #define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
105 #define ID_LISTVIEW 2000
107 #define TOOLBAR_ID (L"SHELLDLL_DefView")
108 /*windowsx.h */
109 #define GET_WM_COMMAND_ID(wp, lp) LOWORD(wp)
110 #define GET_WM_COMMAND_HWND(wp, lp) (HWND)(lp)
111 #define GET_WM_COMMAND_CMD(wp, lp) HIWORD(wp)
112 /* winuser.h */
113 #define WM_SETTINGCHANGE WM_WININICHANGE
114 extern void WINAPI _InsertMenuItem (HMENU hmenu, UINT indexMenu, BOOL fByPosition,
115 UINT wID, UINT fType, LPSTR dwTypeData, UINT fState);
118 Items merged into the toolbar and and the filemenu
120 typedef struct
121 { int idCommand;
122 int iImage;
123 int idButtonString;
124 int idMenuString;
125 BYTE bState;
126 BYTE bStyle;
127 } MYTOOLINFO, *LPMYTOOLINFO;
129 MYTOOLINFO Tools[] =
131 { FCIDM_SHVIEW_BIGICON, 0, 0, IDS_VIEW_LARGE, TBSTATE_ENABLED, TBSTYLE_BUTTON },
132 { FCIDM_SHVIEW_SMALLICON, 0, 0, IDS_VIEW_SMALL, TBSTATE_ENABLED, TBSTYLE_BUTTON },
133 { FCIDM_SHVIEW_LISTVIEW, 0, 0, IDS_VIEW_LIST, TBSTATE_ENABLED, TBSTYLE_BUTTON },
134 { FCIDM_SHVIEW_REPORTVIEW, 0, 0, IDS_VIEW_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON },
135 { -1, 0, 0, 0, 0, 0}
138 typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
140 /**********************************************************
141 * IShellView_Constructor
143 IShellView * IShellView_Constructor( IShellFolder * pFolder)
144 { IShellViewImpl * sv;
145 sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
146 sv->ref=1;
147 ICOM_VTBL(sv)=&svvt;
148 sv->lpvtblOleCommandTarget=&ctvt;
149 sv->lpvtblDropTarget=&dtvt;
150 sv->lpvtblDropSource=&dsvt;
151 sv->lpvtblViewObject=&vovt;
153 sv->pSFParent = pFolder;
155 if(pFolder)
156 IShellFolder_AddRef(pFolder);
158 TRACE("(%p)->(%p)\n",sv, pFolder);
159 shell32_ObjCount++;
160 return (IShellView *) sv;
163 /**********************************************************
165 * ##### helperfunctions for communication with ICommDlgBrowser #####
167 static BOOL IsInCommDlg(IShellViewImpl * This)
168 { return(This->pCommDlgBrowser != NULL);
171 static HRESULT IncludeObject(IShellViewImpl * This, LPCITEMIDLIST pidl)
173 HRESULT ret = S_OK;
175 if ( IsInCommDlg(This) )
177 TRACE("ICommDlgBrowser::IncludeObject pidl=%p\n", pidl);
178 ret = ICommDlgBrowser_IncludeObject(This->pCommDlgBrowser, (IShellView*)This, pidl);
179 TRACE("--0x%08lx\n", ret);
181 return ret;
184 static HRESULT OnDefaultCommand(IShellViewImpl * This)
186 HRESULT ret = S_FALSE;
188 if (IsInCommDlg(This))
190 TRACE("ICommDlgBrowser::OnDefaultCommand\n");
191 ret = ICommDlgBrowser_OnDefaultCommand(This->pCommDlgBrowser, (IShellView*)This);
192 TRACE("--\n");
194 return ret;
197 static HRESULT OnStateChange(IShellViewImpl * This, UINT uFlags)
199 HRESULT ret = S_FALSE;
201 if (IsInCommDlg(This))
203 TRACE("ICommDlgBrowser::OnStateChange flags=%x\n", uFlags);
204 ret = ICommDlgBrowser_OnStateChange(This->pCommDlgBrowser, (IShellView*)This, uFlags);
205 TRACE("--\n");
207 return ret;
209 /**********************************************************
210 * set the toolbar of the filedialog buttons
212 static void CheckToolbar(IShellViewImpl * This)
214 LRESULT result;
216 TRACE("\n");
218 if (IsInCommDlg(This))
220 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
221 FCIDM_TB_SMALLICON, (This->FolderSettings.ViewMode==FVM_LIST)? TRUE : FALSE, &result);
222 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_CHECKBUTTON,
223 FCIDM_TB_REPORTVIEW, (This->FolderSettings.ViewMode==FVM_DETAILS)? TRUE : FALSE, &result);
224 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
225 FCIDM_TB_SMALLICON, TRUE, &result);
226 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_TOOLBAR, TB_ENABLEBUTTON,
227 FCIDM_TB_REPORTVIEW, TRUE, &result);
231 /**********************************************************
233 * ##### helperfunctions for initializing the view #####
235 /**********************************************************
236 * change the style of the listview control
238 static void SetStyle(IShellViewImpl * This, DWORD dwAdd, DWORD dwRemove)
240 DWORD tmpstyle;
242 TRACE("(%p)\n", This);
244 tmpstyle = GetWindowLongA(This->hWndList, GWL_STYLE);
245 SetWindowLongA(This->hWndList, GWL_STYLE, dwAdd | (tmpstyle & ~dwRemove));
248 /**********************************************************
249 * ShellView_CreateList()
252 static BOOL ShellView_CreateList (IShellViewImpl * This)
253 { DWORD dwStyle;
255 TRACE("%p\n",This);
257 dwStyle = WS_TABSTOP | WS_VISIBLE | WS_CHILDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
258 LVS_SHAREIMAGELISTS | LVS_EDITLABELS | LVS_ALIGNLEFT | LVS_AUTOARRANGE;
260 switch (This->FolderSettings.ViewMode)
262 case FVM_ICON: dwStyle |= LVS_ICON; break;
263 case FVM_DETAILS: dwStyle |= LVS_REPORT; break;
264 case FVM_SMALLICON: dwStyle |= LVS_SMALLICON; break;
265 case FVM_LIST: dwStyle |= LVS_LIST; break;
266 default: dwStyle |= LVS_LIST; break;
269 if (This->FolderSettings.fFlags && FWF_AUTOARRANGE) dwStyle |= LVS_AUTOARRANGE;
270 /*if (This->FolderSettings.fFlags && FWF_DESKTOP); used from explorer*/
271 if (This->FolderSettings.fFlags && FWF_SINGLESEL) dwStyle |= LVS_SINGLESEL;
273 This->hWndList=CreateWindowExA( WS_EX_CLIENTEDGE,
274 WC_LISTVIEWA,
275 NULL,
276 dwStyle,
277 0,0,0,0,
278 This->hWnd,
279 (HMENU)ID_LISTVIEW,
280 shell32_hInstance,
281 NULL);
283 if(!This->hWndList)
284 return FALSE;
286 This->ListViewSortInfo.bIsAscending = TRUE;
287 This->ListViewSortInfo.nHeaderID = -1;
288 This->ListViewSortInfo.nLastHeaderID = -1;
290 /* UpdateShellSettings(); */
291 return TRUE;
293 /**********************************************************
294 * ShellView_InitList()
296 * NOTES
297 * FIXME: the headers should depend on the kind of shellfolder
298 * thats creating the shellview. this hack implements only the
299 * correct headers for a filesystem folder (jsch 25/10/99)
301 static BOOL ShellView_InitList(IShellViewImpl * This)
303 LVCOLUMNA lvColumn;
304 CHAR szString[50];
306 TRACE("%p\n",This);
308 ListView_DeleteAllItems(This->hWndList);
310 /*initialize the columns */
311 lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; /* | LVCF_SUBITEM;*/
312 lvColumn.fmt = LVCFMT_LEFT;
313 lvColumn.pszText = szString;
315 lvColumn.cx = 120;
316 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN1, szString, sizeof(szString));
317 ListView_InsertColumnA(This->hWndList, 0, &lvColumn);
319 lvColumn.cx = 60;
320 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN2, szString, sizeof(szString));
321 ListView_InsertColumnA(This->hWndList, 1, &lvColumn);
323 lvColumn.cx = 120;
324 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN3, szString, sizeof(szString));
325 ListView_InsertColumnA(This->hWndList, 2, &lvColumn);
327 lvColumn.cx = 60;
328 LoadStringA(shell32_hInstance, IDS_SHV_COLUMN4, szString, sizeof(szString));
329 ListView_InsertColumnA(This->hWndList, 3, &lvColumn);
331 ListView_SetImageList(This->hWndList, ShellSmallIconList, LVSIL_SMALL);
332 ListView_SetImageList(This->hWndList, ShellBigIconList, LVSIL_NORMAL);
334 return TRUE;
336 /**********************************************************
337 * ShellView_CompareItems()
339 * NOTES
340 * internal, CALLBACK for DSA_Sort
342 static INT CALLBACK ShellView_CompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
344 int ret;
345 TRACE("pidl1=%p pidl2=%p lpsf=%p\n", lParam1, lParam2, (LPVOID) lpData);
347 if(!lpData) return 0;
349 ret = (SHORT) SCODE_CODE(IShellFolder_CompareIDs((LPSHELLFOLDER)lpData, 0, (LPITEMIDLIST)lParam1, (LPITEMIDLIST)lParam2));
350 TRACE("ret=%i\n",ret);
351 return ret;
354 /*************************************************************************
355 * ShellView_ListViewCompareItems
357 * Compare Function for the Listview (FileOpen Dialog)
359 * PARAMS
360 * lParam1 [I] the first ItemIdList to compare with
361 * lParam2 [I] the second ItemIdList to compare with
362 * lpData [I] The column ID for the header Ctrl to process
364 * RETURNS
365 * A negative value if the first item should precede the second,
366 * a positive value if the first item should follow the second,
367 * or zero if the two items are equivalent
369 * NOTES
370 * FIXME: function does what ShellView_CompareItems is supposed to do.
371 * unify it and figure out how to use the undocumented first parameter
372 * of IShellFolder_CompareIDs to do the job this function does and
373 * move this code to IShellFolder.
374 * make LISTVIEW_SORT_INFO obsolete
375 * the way this function works is only usable if we had only
376 * filesystemfolders (25/10/99 jsch)
378 static INT CALLBACK ShellView_ListViewCompareItems(LPVOID lParam1, LPVOID lParam2, LPARAM lpData)
380 INT nDiff=0;
381 FILETIME fd1, fd2;
382 char strName1[MAX_PATH], strName2[MAX_PATH];
383 BOOL bIsFolder1, bIsFolder2,bIsBothFolder;
384 LPITEMIDLIST pItemIdList1 = (LPITEMIDLIST) lParam1;
385 LPITEMIDLIST pItemIdList2 = (LPITEMIDLIST) lParam2;
386 LISTVIEW_SORT_INFO *pSortInfo = (LPLISTVIEW_SORT_INFO) lpData;
389 bIsFolder1 = _ILIsFolder(pItemIdList1);
390 bIsFolder2 = _ILIsFolder(pItemIdList2);
391 bIsBothFolder = bIsFolder1 && bIsFolder2;
393 /* When sorting between a File and a Folder, the Folder gets sorted first */
394 if( (bIsFolder1 || bIsFolder2) && !bIsBothFolder)
396 nDiff = bIsFolder1 ? -1 : 1;
398 else
400 /* Sort by Time: Folders or Files can be sorted */
402 if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_TIME)
404 _ILGetFileDateTime(pItemIdList1, &fd1);
405 _ILGetFileDateTime(pItemIdList2, &fd2);
406 nDiff = CompareFileTime(&fd2, &fd1);
408 /* Sort by Attribute: Folder or Files can be sorted */
409 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_ATTRIB)
411 _ILGetAttributeStr(pItemIdList1, strName1, MAX_PATH);
412 _ILGetAttributeStr(pItemIdList2, strName2, MAX_PATH);
413 nDiff = strcasecmp(strName1, strName2);
415 /* Sort by FileName: Folder or Files can be sorted */
416 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_NAME || bIsBothFolder)
418 /* Sort by Text */
419 _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
420 _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
421 nDiff = strcasecmp(strName1, strName2);
423 /* Sort by File Size, Only valid for Files */
424 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_SIZE)
426 nDiff = (INT)(_ILGetFileSize(pItemIdList1, NULL, 0) - _ILGetFileSize(pItemIdList2, NULL, 0));
428 /* Sort by File Type, Only valid for Files */
429 else if(pSortInfo->nHeaderID == LISTVIEW_COLUMN_TYPE)
431 /* Sort by Type */
432 _ILGetFileType(pItemIdList1, strName1, MAX_PATH);
433 _ILGetFileType(pItemIdList2, strName2, MAX_PATH);
434 nDiff = strcasecmp(strName1, strName2);
437 /* If the Date, FileSize, FileType, Attrib was the same, sort by FileName */
439 if(nDiff == 0)
441 _ILSimpleGetText(pItemIdList1, strName1, MAX_PATH);
442 _ILSimpleGetText(pItemIdList2, strName2, MAX_PATH);
443 nDiff = strcasecmp(strName1, strName2);
446 if(!pSortInfo->bIsAscending)
448 nDiff = -nDiff;
451 return nDiff;
455 /**********************************************************
456 * ShellView_FillList()
458 * NOTES
459 * internal
462 static HRESULT ShellView_FillList(IShellViewImpl * This)
464 LPENUMIDLIST pEnumIDList;
465 LPITEMIDLIST pidl;
466 DWORD dwFetched;
467 UINT i;
468 LVITEMA lvItem;
469 HRESULT hRes;
470 HDPA hdpa;
472 TRACE("%p\n",This);
474 /* get the itemlist from the shfolder*/
475 hRes = IShellFolder_EnumObjects(This->pSFParent,This->hWnd, SHCONTF_NONFOLDERS | SHCONTF_FOLDERS, &pEnumIDList);
476 if (hRes != S_OK)
478 if (hRes==S_FALSE)
479 return(NOERROR);
480 return(hRes);
483 /* create a pointer array */
484 hdpa = pDPA_Create(16);
485 if (!hdpa)
487 return(E_OUTOFMEMORY);
490 /* copy the items into the array*/
491 while((S_OK == IEnumIDList_Next(pEnumIDList,1, &pidl, &dwFetched)) && dwFetched)
493 if (pDPA_InsertPtr(hdpa, 0x7fff, pidl) == -1)
495 SHFree(pidl);
499 /*sort the array*/
500 pDPA_Sort(hdpa, ShellView_CompareItems, (LPARAM)This->pSFParent);
502 /*turn the listview's redrawing off*/
503 SendMessageA(This->hWndList, WM_SETREDRAW, FALSE, 0);
505 for (i=0; i < DPA_GetPtrCount(hdpa); ++i) /* DPA_GetPtrCount is a macro*/
507 pidl = (LPITEMIDLIST)DPA_GetPtr(hdpa, i);
508 if (IncludeObject(This, pidl) == S_OK) /* in a commdlg This works as a filemask*/
510 ZeroMemory(&lvItem, sizeof(lvItem)); /* create the listviewitem*/
511 lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; /*set the mask*/
512 lvItem.iItem = ListView_GetItemCount(This->hWndList); /*add the item to the end of the list*/
513 lvItem.lParam = (LPARAM) pidl; /*set the item's data*/
514 lvItem.pszText = LPSTR_TEXTCALLBACKA; /*get text on a callback basis*/
515 lvItem.iImage = I_IMAGECALLBACK; /*get the image on a callback basis*/
516 ListView_InsertItemA(This->hWndList, &lvItem);
518 else
519 SHFree(pidl); /* the listview has the COPY*/
522 /*turn the listview's redrawing back on and force it to draw*/
523 SendMessageA(This->hWndList, WM_SETREDRAW, TRUE, 0);
524 InvalidateRect(This->hWndList, NULL, TRUE);
525 UpdateWindow(This->hWndList);
527 IEnumIDList_Release(pEnumIDList); /* destroy the list*/
528 pDPA_Destroy(hdpa);
530 return S_OK;
533 /**********************************************************
534 * ShellView_OnCreate()
536 static LRESULT ShellView_OnCreate(IShellViewImpl * This)
538 #if 0
539 IDropTarget* pdt;
540 #endif
541 TRACE("%p\n",This);
543 if(ShellView_CreateList(This))
545 if(ShellView_InitList(This))
547 ShellView_FillList(This);
551 #if 0
552 /* This makes a chrash since we havn't called OleInititialize. But if we
553 do this call in DllMain it breaks some apps. The native shell32 does not
554 call OleInitialize and not even depend on ole32.dll.
555 But for some apps it works...*/
556 if (SUCCEEDED(IShellFolder_CreateViewObject(This->pSFParent, This->hWnd, &IID_IDropTarget, (LPVOID*)&pdt)))
558 pRegisterDragDrop(This->hWnd, pdt);
559 IDropTarget_Release(pdt);
561 #endif
562 return S_OK;
565 /**********************************************************
566 * #### Handling of the menus ####
569 /**********************************************************
570 * ShellView_BuildFileMenu()
572 static HMENU ShellView_BuildFileMenu(IShellViewImpl * This)
573 { CHAR szText[MAX_PATH];
574 MENUITEMINFOA mii;
575 int nTools,i;
576 HMENU hSubMenu;
578 TRACE("(%p)\n",This);
580 hSubMenu = CreatePopupMenu();
581 if(hSubMenu)
582 { /*get the number of items in our global array*/
583 for(nTools = 0; Tools[nTools].idCommand != -1; nTools++){}
585 /*add the menu items*/
586 for(i = 0; i < nTools; i++)
588 LoadStringA(shell32_hInstance, Tools[i].idMenuString, szText, MAX_PATH);
590 ZeroMemory(&mii, sizeof(mii));
591 mii.cbSize = sizeof(mii);
592 mii.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
594 if(TBSTYLE_SEP != Tools[i].bStyle) /* no seperator*/
596 mii.fType = MFT_STRING;
597 mii.fState = MFS_ENABLED;
598 mii.dwTypeData = szText;
599 mii.wID = Tools[i].idCommand;
601 else
603 mii.fType = MFT_SEPARATOR;
605 /* tack This item onto the end of the menu */
606 InsertMenuItemA(hSubMenu, (UINT)-1, TRUE, &mii);
609 TRACE("-- return (menu=0x%x)\n",hSubMenu);
610 return hSubMenu;
612 /**********************************************************
613 * ShellView_MergeFileMenu()
615 static void ShellView_MergeFileMenu(IShellViewImpl * This, HMENU hSubMenu)
616 { TRACE("(%p)->(submenu=0x%08x) stub\n",This,hSubMenu);
618 if(hSubMenu)
619 { /*insert This item at the beginning of the menu */
620 _InsertMenuItem(hSubMenu, 0, TRUE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED);
621 _InsertMenuItem(hSubMenu, 0, TRUE, IDM_MYFILEITEM, MFT_STRING, "dummy45", MFS_ENABLED);
624 TRACE("--\n");
627 /**********************************************************
628 * ShellView_MergeViewMenu()
631 static void ShellView_MergeViewMenu(IShellViewImpl * This, HMENU hSubMenu)
632 { MENUITEMINFOA mii;
634 TRACE("(%p)->(submenu=0x%08x)\n",This,hSubMenu);
636 if(hSubMenu)
637 { /*add a separator at the correct position in the menu*/
638 _InsertMenuItem(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, 0, MFT_SEPARATOR, NULL, MFS_ENABLED);
640 ZeroMemory(&mii, sizeof(mii));
641 mii.cbSize = sizeof(mii);
642 mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;;
643 mii.fType = MFT_STRING;
644 mii.dwTypeData = "View";
645 mii.hSubMenu = LoadMenuA(shell32_hInstance, "MENU_001");
646 InsertMenuItemA(hSubMenu, FCIDM_MENU_VIEW_SEP_OPTIONS, FALSE, &mii);
650 /**********************************************************
651 * ShellView_GetSelections()
653 * RETURNS
654 * number of selected items
656 static UINT ShellView_GetSelections(IShellViewImpl * This)
658 LVITEMA lvItem;
659 UINT i = 0;
661 if (This->apidl)
663 SHFree(This->apidl);
666 This->cidl = ListView_GetSelectedCount(This->hWndList);
667 This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
669 TRACE("selected=%i\n", This->cidl);
671 if(This->apidl)
673 TRACE("-- Items selected =%u\n", This->cidl);
675 ZeroMemory(&lvItem, sizeof(lvItem));
676 lvItem.mask = LVIF_STATE | LVIF_PARAM;
677 lvItem.stateMask = LVIS_SELECTED;
679 while(ListView_GetItemA(This->hWndList, &lvItem) && (i < This->cidl))
681 if(lvItem.state & LVIS_SELECTED)
683 This->apidl[i] = (LPITEMIDLIST)lvItem.lParam;
684 i++;
685 TRACE("-- selected Item found\n");
687 lvItem.iItem++;
690 return This->cidl;
693 /**********************************************************
694 * ShellView_DoContextMenu()
696 static void ShellView_DoContextMenu(IShellViewImpl * This, WORD x, WORD y, BOOL bDefault)
697 { UINT uCommand;
698 DWORD wFlags;
699 HMENU hMenu;
700 BOOL fExplore = FALSE;
701 HWND hwndTree = 0;
702 LPCONTEXTMENU pContextMenu = NULL;
703 IContextMenu * pCM = NULL;
704 CMINVOKECOMMANDINFO cmi;
706 TRACE("(%p)->(0x%08x 0x%08x 0x%08x) stub\n",This, x, y, bDefault);
708 /* look, what's selected and create a context menu object of it*/
709 if( ShellView_GetSelections(This) )
711 IShellFolder_GetUIObjectOf( This->pSFParent, This->hWndParent, This->cidl, This->apidl,
712 (REFIID)&IID_IContextMenu, NULL, (LPVOID *)&pContextMenu);
714 if(pContextMenu)
716 TRACE("-- pContextMenu\n");
717 hMenu = CreatePopupMenu();
719 if( hMenu )
721 /* See if we are in Explore or Open mode. If the browser's tree is present, we are in Explore mode.*/
722 if(SUCCEEDED(IShellBrowser_GetControlWindow(This->pShellBrowser,FCW_TREE, &hwndTree)) && hwndTree)
724 TRACE("-- explore mode\n");
725 fExplore = TRUE;
728 /* build the flags depending on what we can do with the selected item */
729 wFlags = CMF_NORMAL | (This->cidl != 1 ? 0 : CMF_CANRENAME) | (fExplore ? CMF_EXPLORE : 0);
731 /* let the ContextMenu merge its items in */
732 if (SUCCEEDED(IContextMenu_QueryContextMenu( pContextMenu, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, wFlags )))
734 if( bDefault )
736 TRACE("-- get menu default command\n");
737 uCommand = GetMenuDefaultItem(hMenu, FALSE, GMDI_GOINTOPOPUPS);
739 else
741 TRACE("-- track popup\n");
742 uCommand = TrackPopupMenu( hMenu,TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL);
745 if(uCommand > 0)
747 TRACE("-- uCommand=%u\n", uCommand);
748 if (IsInCommDlg(This) && ((uCommand==IDM_EXPLORE) || (uCommand==IDM_OPEN)))
750 TRACE("-- dlg: OnDefaultCommand\n");
751 OnDefaultCommand(This);
753 else
755 TRACE("-- explore -- invoke command\n");
756 ZeroMemory(&cmi, sizeof(cmi));
757 cmi.cbSize = sizeof(cmi);
758 cmi.hwnd = This->hWndParent;
759 cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand);
760 IContextMenu_InvokeCommand(pContextMenu, &cmi);
763 DestroyMenu(hMenu);
766 if (pContextMenu)
767 IContextMenu_Release(pContextMenu);
770 else /* background context menu */
772 hMenu = CreatePopupMenu();
774 pCM = ISvBgCm_Constructor();
775 IContextMenu_QueryContextMenu(pCM, hMenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, 0);
777 uCommand = TrackPopupMenu( hMenu, TPM_LEFTALIGN | TPM_RETURNCMD,x,y,0,This->hWnd,NULL);
778 DestroyMenu(hMenu);
780 TRACE("-- (%p)->(uCommand=0x%08x )\n",This, uCommand);
782 ZeroMemory(&cmi, sizeof(cmi));
783 cmi.cbSize = sizeof(cmi);
784 cmi.lpVerb = (LPCSTR)MAKEINTRESOURCEA(uCommand);
785 cmi.hwnd = This->hWndParent;
786 IContextMenu_InvokeCommand(pCM, &cmi);
788 IContextMenu_Release(pCM);
792 /**********************************************************
793 * ##### message handling #####
796 /**********************************************************
797 * ShellView_OnSize()
799 static LRESULT ShellView_OnSize(IShellViewImpl * This, WORD wWidth, WORD wHeight)
801 TRACE("%p width=%u height=%u\n",This, wWidth,wHeight);
803 /*resize the ListView to fit our window*/
804 if(This->hWndList)
806 MoveWindow(This->hWndList, 0, 0, wWidth, wHeight, TRUE);
809 return S_OK;
811 /**********************************************************
812 * ShellView_OnDeactivate()
814 * NOTES
815 * internal
817 static void ShellView_OnDeactivate(IShellViewImpl * This)
819 TRACE("%p\n",This);
821 if(This->uState != SVUIA_DEACTIVATE)
823 if(This->hMenu)
825 IShellBrowser_SetMenuSB(This->pShellBrowser,0, 0, 0);
826 IShellBrowser_RemoveMenusSB(This->pShellBrowser,This->hMenu);
827 DestroyMenu(This->hMenu);
828 This->hMenu = 0;
831 This->uState = SVUIA_DEACTIVATE;
835 /**********************************************************
836 * ShellView_OnActivate()
838 static LRESULT ShellView_OnActivate(IShellViewImpl * This, UINT uState)
839 { OLEMENUGROUPWIDTHS omw = { {0, 0, 0, 0, 0, 0} };
840 MENUITEMINFOA mii;
841 CHAR szText[MAX_PATH];
843 TRACE("%p uState=%x\n",This,uState);
845 /*don't do anything if the state isn't really changing */
846 if(This->uState == uState)
848 return S_OK;
851 ShellView_OnDeactivate(This);
853 /*only do This if we are active */
854 if(uState != SVUIA_DEACTIVATE)
856 /*merge the menus */
857 This->hMenu = CreateMenu();
859 if(This->hMenu)
861 IShellBrowser_InsertMenusSB(This->pShellBrowser, This->hMenu, &omw);
862 TRACE("-- after fnInsertMenusSB\n");
864 /*build the top level menu get the menu item's text*/
865 strcpy(szText,"dummy 31");
867 ZeroMemory(&mii, sizeof(mii));
868 mii.cbSize = sizeof(mii);
869 mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_STATE;
870 mii.fType = MFT_STRING;
871 mii.fState = MFS_ENABLED;
872 mii.dwTypeData = szText;
873 mii.hSubMenu = ShellView_BuildFileMenu(This);
875 /*insert our menu into the menu bar*/
876 if(mii.hSubMenu)
878 InsertMenuItemA(This->hMenu, FCIDM_MENU_HELP, FALSE, &mii);
881 /*get the view menu so we can merge with it*/
882 ZeroMemory(&mii, sizeof(mii));
883 mii.cbSize = sizeof(mii);
884 mii.fMask = MIIM_SUBMENU;
886 if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_VIEW, FALSE, &mii))
888 ShellView_MergeViewMenu(This, mii.hSubMenu);
891 /*add the items that should only be added if we have the focus*/
892 if(SVUIA_ACTIVATE_FOCUS == uState)
894 /*get the file menu so we can merge with it */
895 ZeroMemory(&mii, sizeof(mii));
896 mii.cbSize = sizeof(mii);
897 mii.fMask = MIIM_SUBMENU;
899 if(GetMenuItemInfoA(This->hMenu, FCIDM_MENU_FILE, FALSE, &mii))
901 ShellView_MergeFileMenu(This, mii.hSubMenu);
904 TRACE("-- before fnSetMenuSB\n");
905 IShellBrowser_SetMenuSB(This->pShellBrowser, This->hMenu, 0, This->hWnd);
908 This->uState = uState;
909 TRACE("--\n");
910 return S_OK;
913 /**********************************************************
914 * ShellView_OnSetFocus()
917 static LRESULT ShellView_OnSetFocus(IShellViewImpl * This)
919 TRACE("%p\n",This);
921 /* Tell the browser one of our windows has received the focus. This
922 should always be done before merging menus (OnActivate merges the
923 menus) if one of our windows has the focus.*/
925 IShellBrowser_OnViewWindowActive(This->pShellBrowser,(IShellView*) This);
926 ShellView_OnActivate(This, SVUIA_ACTIVATE_FOCUS);
928 /* Set the focus to the listview */
929 SetFocus(This->hWndList);
931 /* Notify the ICommDlgBrowser interface */
932 OnStateChange(This,CDBOSC_SETFOCUS);
934 return 0;
937 /**********************************************************
938 * ShellView_OnKillFocus()
940 static LRESULT ShellView_OnKillFocus(IShellViewImpl * This)
942 TRACE("(%p) stub\n",This);
944 ShellView_OnActivate(This, SVUIA_ACTIVATE_NOFOCUS);
945 /* Notify the ICommDlgBrowser */
946 OnStateChange(This,CDBOSC_KILLFOCUS);
948 return 0;
951 /**********************************************************
952 * ShellView_OnCommand()
954 * NOTES
955 * the CmdID's are the ones from the context menu
957 static LRESULT ShellView_OnCommand(IShellViewImpl * This,DWORD dwCmdID, DWORD dwCmd, HWND hwndCmd)
959 TRACE("(%p)->(0x%08lx 0x%08lx 0x%08x) stub\n",This, dwCmdID, dwCmd, hwndCmd);
961 switch(dwCmdID)
963 case FCIDM_SHVIEW_SMALLICON:
964 This->FolderSettings.ViewMode = FVM_SMALLICON;
965 SetStyle (This, LVS_SMALLICON, LVS_TYPEMASK);
966 CheckToolbar(This);
967 break;
969 case FCIDM_SHVIEW_BIGICON:
970 This->FolderSettings.ViewMode = FVM_ICON;
971 SetStyle (This, LVS_ICON, LVS_TYPEMASK);
972 CheckToolbar(This);
973 break;
975 case FCIDM_SHVIEW_LISTVIEW:
976 This->FolderSettings.ViewMode = FVM_LIST;
977 SetStyle (This, LVS_LIST, LVS_TYPEMASK);
978 CheckToolbar(This);
979 break;
981 case FCIDM_SHVIEW_REPORTVIEW:
982 This->FolderSettings.ViewMode = FVM_DETAILS;
983 SetStyle (This, LVS_REPORT, LVS_TYPEMASK);
984 CheckToolbar(This);
985 break;
987 /* the menu-ID's for sorting are 0x30... see shrec.rc */
988 case 0x30:
989 case 0x31:
990 case 0x32:
991 case 0x33:
992 This->ListViewSortInfo.nHeaderID = (LPARAM) (dwCmdID - 0x30);
993 This->ListViewSortInfo.bIsAscending = TRUE;
994 This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
995 ListView_SortItems(This->hWndList, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
996 break;
998 default:
999 TRACE("-- COMMAND 0x%04lx unhandled\n", dwCmdID);
1001 return 0;
1004 /**********************************************************
1005 * ShellView_OnNotify()
1008 static LRESULT ShellView_OnNotify(IShellViewImpl * This, UINT CtlID, LPNMHDR lpnmh)
1009 { LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW)lpnmh;
1010 NMLVDISPINFOA *lpdi = (NMLVDISPINFOA *)lpnmh;
1011 LPITEMIDLIST pidl;
1012 STRRET str;
1014 TRACE("%p CtlID=%u lpnmh->code=%x\n",This,CtlID,lpnmh->code);
1016 switch(lpnmh->code)
1018 case NM_SETFOCUS:
1019 TRACE("-- NM_SETFOCUS %p\n",This);
1020 ShellView_OnSetFocus(This);
1021 break;
1023 case NM_KILLFOCUS:
1024 TRACE("-- NM_KILLFOCUS %p\n",This);
1025 ShellView_OnDeactivate(This);
1026 /* Notify the ICommDlgBrowser interface */
1027 OnStateChange(This,CDBOSC_KILLFOCUS);
1028 break;
1030 case HDN_ENDTRACKA:
1031 TRACE("-- HDN_ENDTRACKA %p\n",This);
1032 /*nColumn1 = ListView_GetColumnWidth(This->hWndList, 0);
1033 nColumn2 = ListView_GetColumnWidth(This->hWndList, 1);*/
1034 break;
1036 case LVN_DELETEITEM:
1037 TRACE("-- LVN_DELETEITEM %p\n",This);
1038 SHFree((LPITEMIDLIST)lpnmlv->lParam); /*delete the pidl because we made a copy of it*/
1039 break;
1041 case LVN_ITEMACTIVATE:
1042 TRACE("-- LVN_ITEMACTIVATE %p\n",This);
1043 OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */
1044 ShellView_DoContextMenu(This, 0, 0, TRUE);
1045 break;
1047 case LVN_COLUMNCLICK:
1048 This->ListViewSortInfo.nHeaderID = lpnmlv->iSubItem;
1049 if(This->ListViewSortInfo.nLastHeaderID == This->ListViewSortInfo.nHeaderID)
1051 This->ListViewSortInfo.bIsAscending = !This->ListViewSortInfo.bIsAscending;
1053 else
1055 This->ListViewSortInfo.bIsAscending = TRUE;
1057 This->ListViewSortInfo.nLastHeaderID = This->ListViewSortInfo.nHeaderID;
1059 ListView_SortItems(lpnmlv->hdr.hwndFrom, ShellView_ListViewCompareItems, (LPARAM) (&(This->ListViewSortInfo)));
1060 break;
1062 case LVN_GETDISPINFOA:
1063 TRACE("-- LVN_GETDISPINFOA %p\n",This);
1064 pidl = (LPITEMIDLIST)lpdi->item.lParam;
1067 if(lpdi->item.iSubItem) /*is the sub-item information being requested?*/
1068 { if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
1069 { if(_ILIsValue(pidl)) /*is This a value or a folder?*/
1070 { switch (lpdi->item.iSubItem)
1071 { case 1: /* size */
1072 _ILGetFileSize (pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
1073 break;
1074 case 2: /* extension */
1075 { char sTemp[64];
1076 if (_ILGetExtension (pidl, sTemp, 64))
1077 { if (!( HCR_MapTypeToValue(sTemp, sTemp, 64, TRUE)
1078 && HCR_MapTypeToValue(sTemp, lpdi->item.pszText, lpdi->item.cchTextMax, FALSE )))
1079 { lstrcpynA (lpdi->item.pszText, sTemp, lpdi->item.cchTextMax);
1080 strncat (lpdi->item.pszText, "-file", lpdi->item.cchTextMax);
1083 else /* no extension found */
1084 { lpdi->item.pszText[0]=0x00;
1087 break;
1088 case 3: /* date */
1089 _ILGetFileDate (pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
1090 break;
1093 else /*its a folder*/
1094 { switch (lpdi->item.iSubItem)
1095 { case 1:
1096 strcpy(lpdi->item.pszText, "");
1097 break;
1098 case 2:
1099 lstrcpynA (lpdi->item.pszText, "Folder", lpdi->item.cchTextMax);
1100 break;
1101 case 3:
1102 _ILGetFileDate (pidl, lpdi->item.pszText, lpdi->item.cchTextMax);
1103 break;
1106 TRACE("-- text=%s\n",lpdi->item.pszText);
1109 else /*the item text is being requested*/
1111 if(lpdi->item.mask & LVIF_TEXT) /*is the text being requested?*/
1113 if(SUCCEEDED(IShellFolder_GetDisplayNameOf(This->pSFParent,pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &str)))
1115 StrRetToStrNA(lpdi->item.pszText, lpdi->item.cchTextMax, &str, pidl);
1117 TRACE("-- text=%s\n",lpdi->item.pszText);
1120 if(lpdi->item.mask & LVIF_IMAGE) /*is the image being requested?*/
1122 lpdi->item.iImage = SHMapPIDLToSystemImageListIndex(This->pSFParent, pidl, 0);
1125 break;
1127 case LVN_ITEMCHANGED:
1128 TRACE("-- LVN_ITEMCHANGED %p\n",This);
1129 OnStateChange(This, CDBOSC_SELCHANGE); /* the browser will get the IDataObject now */
1130 break;
1132 case LVN_BEGINDRAG:
1133 case LVN_BEGINRDRAG:
1135 if (ShellView_GetSelections(This))
1137 IDataObject * pda;
1138 DWORD dwAttributes;
1139 DWORD dwEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE;
1141 if (SUCCEEDED(IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, This->apidl, &IID_IDataObject,0,(LPVOID *)&pda)))
1143 IDropSource * pds = (IDropSource*)&(This->lpvtblDropSource); /* own DropSource interface */
1145 if (SUCCEEDED(IShellFolder_GetAttributesOf(This->pSFParent, This->cidl, This->apidl, &dwAttributes)))
1147 if (dwAttributes & SFGAO_CANLINK)
1149 dwEffect |= DROPEFFECT_LINK;
1153 if (pds)
1155 DWORD dwEffect;
1156 pDoDragDrop(pda, pds, dwEffect, &dwEffect);
1159 IDataObject_Release(pda);
1162 break;
1164 case LVN_BEGINLABELEDITA:
1165 case LVN_ENDLABELEDITA:
1166 FIXME("labeledit\n");
1167 break;
1169 default:
1170 TRACE("-- %p WM_COMMAND %s unhandled\n", This, SPY_GetMsgName(lpnmh->code));
1171 break;;
1173 return 0;
1176 /**********************************************************
1177 * ShellView_WndProc
1180 static LRESULT CALLBACK ShellView_WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam)
1182 IShellViewImpl * pThis = (IShellViewImpl*)GetWindowLongA(hWnd, GWL_USERDATA);
1183 LPCREATESTRUCTA lpcs;
1185 TRACE("(hwnd=%x msg=%x wparm=%x lparm=%lx)\n",hWnd, uMessage, wParam, lParam);
1187 switch (uMessage)
1189 case WM_NCCREATE:
1190 lpcs = (LPCREATESTRUCTA)lParam;
1191 pThis = (IShellViewImpl*)(lpcs->lpCreateParams);
1192 SetWindowLongA(hWnd, GWL_USERDATA, (LONG)pThis);
1193 pThis->hWnd = hWnd; /*set the window handle*/
1194 break;
1196 case WM_SIZE: return ShellView_OnSize(pThis,LOWORD(lParam), HIWORD(lParam));
1197 case WM_SETFOCUS: return ShellView_OnSetFocus(pThis);
1198 case WM_KILLFOCUS: return ShellView_OnKillFocus(pThis);
1199 case WM_CREATE: return ShellView_OnCreate(pThis);
1200 case WM_ACTIVATE: return ShellView_OnActivate(pThis, SVUIA_ACTIVATE_FOCUS);
1201 case WM_NOTIFY: return ShellView_OnNotify(pThis,(UINT)wParam, (LPNMHDR)lParam);
1202 case WM_COMMAND: return ShellView_OnCommand(pThis,
1203 GET_WM_COMMAND_ID(wParam, lParam),
1204 GET_WM_COMMAND_CMD(wParam, lParam),
1205 GET_WM_COMMAND_HWND(wParam, lParam));
1207 case WM_CONTEXTMENU: ShellView_DoContextMenu(pThis, LOWORD(lParam), HIWORD(lParam), FALSE);
1208 return 0;
1210 case WM_SHOWWINDOW: UpdateWindow(pThis->hWndList);
1211 break;
1213 case WM_GETDLGCODE: return SendMessageA(pThis->hWndList,uMessage,0,0);
1215 case WM_DESTROY: pRevokeDragDrop(pThis->hWnd);
1216 break;
1219 return DefWindowProcA (hWnd, uMessage, wParam, lParam);
1221 /**********************************************************
1224 * The INTERFACE of the IShellView object
1227 **********************************************************
1228 * IShellView_QueryInterface
1230 static HRESULT WINAPI IShellView_fnQueryInterface(IShellView * iface,REFIID riid, LPVOID *ppvObj)
1232 ICOM_THIS(IShellViewImpl, iface);
1234 char xriid[50];
1235 WINE_StringFromCLSID((LPCLSID)riid,xriid);
1236 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj);
1238 *ppvObj = NULL;
1240 if(IsEqualIID(riid, &IID_IUnknown))
1242 *ppvObj = This;
1244 else if(IsEqualIID(riid, &IID_IShellView))
1246 *ppvObj = (IShellView*)This;
1248 else if(IsEqualIID(riid, &IID_IOleCommandTarget))
1250 *ppvObj = (IOleCommandTarget*)&(This->lpvtblOleCommandTarget);
1252 else if(IsEqualIID(riid, &IID_IDropTarget))
1254 *ppvObj = (IDropTarget*)&(This->lpvtblDropTarget);
1256 else if(IsEqualIID(riid, &IID_IDropSource))
1258 *ppvObj = (IDropSource*)&(This->lpvtblDropSource);
1260 else if(IsEqualIID(riid, &IID_IViewObject))
1262 *ppvObj = (IViewObject*)&(This->lpvtblViewObject);
1265 if(*ppvObj)
1267 IUnknown_AddRef( (IUnknown*)*ppvObj );
1268 TRACE("-- Interface: (%p)->(%p)\n",ppvObj,*ppvObj);
1269 return S_OK;
1271 TRACE("-- Interface: E_NOINTERFACE\n");
1272 return E_NOINTERFACE;
1275 /**********************************************************
1276 * IShellView_AddRef
1278 static ULONG WINAPI IShellView_fnAddRef(IShellView * iface)
1280 ICOM_THIS(IShellViewImpl, iface);
1282 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1284 shell32_ObjCount++;
1285 return ++(This->ref);
1287 /**********************************************************
1288 * IShellView_Release
1290 static ULONG WINAPI IShellView_fnRelease(IShellView * iface)
1292 ICOM_THIS(IShellViewImpl, iface);
1294 TRACE("(%p)->()\n",This);
1296 shell32_ObjCount--;
1298 if (!--(This->ref))
1300 TRACE(" destroying IShellView(%p)\n",This);
1302 if(This->pSFParent)
1303 IShellFolder_Release(This->pSFParent);
1305 if (This->apidl)
1306 SHFree(This->apidl);
1308 if (This->pCommDlgBrowser)
1309 ICommDlgBrowser_Release(This->pCommDlgBrowser);
1311 HeapFree(GetProcessHeap(),0,This);
1312 return 0;
1314 return This->ref;
1317 /**********************************************************
1318 * ShellView_GetWindow
1320 static HRESULT WINAPI IShellView_fnGetWindow(IShellView * iface,HWND * phWnd)
1322 ICOM_THIS(IShellViewImpl, iface);
1324 TRACE("(%p)\n",This);
1326 *phWnd = This->hWnd;
1328 return S_OK;
1331 static HRESULT WINAPI IShellView_fnContextSensitiveHelp(IShellView * iface,BOOL fEnterMode)
1333 ICOM_THIS(IShellViewImpl, iface);
1335 FIXME("(%p) stub\n",This);
1337 return E_NOTIMPL;
1340 /**********************************************************
1341 * IShellView_TranslateAccelerator
1343 * FIXME:
1344 * use the accel functions
1346 static HRESULT WINAPI IShellView_fnTranslateAccelerator(IShellView * iface,LPMSG lpmsg)
1348 ICOM_THIS(IShellViewImpl, iface);
1350 #if 0
1351 FIXME("(%p)->(%p: hwnd=%x msg=%x lp=%lx wp=%x) stub\n",This,lpmsg, lpmsg->hwnd, lpmsg->message, lpmsg->lParam, lpmsg->wParam);
1352 #endif
1354 if ((lpmsg->message>=WM_KEYFIRST) && (lpmsg->message>=WM_KEYLAST))
1356 TRACE("-- key=0x04%x",lpmsg->wParam) ;
1358 return S_FALSE; /* not handled */
1361 static HRESULT WINAPI IShellView_fnEnableModeless(IShellView * iface,BOOL fEnable)
1363 ICOM_THIS(IShellViewImpl, iface);
1365 FIXME("(%p) stub\n",This);
1367 return E_NOTIMPL;
1370 static HRESULT WINAPI IShellView_fnUIActivate(IShellView * iface,UINT uState)
1372 ICOM_THIS(IShellViewImpl, iface);
1375 CHAR szName[MAX_PATH];
1377 LRESULT lResult;
1378 int nPartArray[1] = {-1};
1380 TRACE("(%p)->(state=%x) stub\n",This, uState);
1382 /*don't do anything if the state isn't really changing*/
1383 if(This->uState == uState)
1385 return S_OK;
1388 /*OnActivate handles the menu merging and internal state*/
1389 ShellView_OnActivate(This, uState);
1391 /*only do This if we are active*/
1392 if(uState != SVUIA_DEACTIVATE)
1396 GetFolderPath is not a method of IShellFolder
1397 IShellFolder_GetFolderPath( This->pSFParent, szName, sizeof(szName) );
1399 /* set the number of parts */
1400 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETPARTS, 1,
1401 (LPARAM)nPartArray, &lResult);
1403 /* set the text for the parts */
1405 IShellBrowser_SendControlMsg(This->pShellBrowser, FCW_STATUS, SB_SETTEXTA,
1406 0, (LPARAM)szName, &lResult);
1410 return S_OK;
1413 static HRESULT WINAPI IShellView_fnRefresh(IShellView * iface)
1415 ICOM_THIS(IShellViewImpl, iface);
1417 TRACE("(%p)\n",This);
1419 ListView_DeleteAllItems(This->hWndList);
1420 ShellView_FillList(This);
1422 return S_OK;
1425 static HRESULT WINAPI IShellView_fnCreateViewWindow(
1426 IShellView * iface,
1427 IShellView *lpPrevView,
1428 LPCFOLDERSETTINGS lpfs,
1429 IShellBrowser * psb,
1430 RECT * prcView,
1431 HWND *phWnd)
1433 ICOM_THIS(IShellViewImpl, iface);
1435 WNDCLASSA wc;
1436 *phWnd = 0;
1439 TRACE("(%p)->(shlview=%p set=%p shlbrs=%p rec=%p hwnd=%p) incomplete\n",This, lpPrevView,lpfs, psb, prcView, phWnd);
1440 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);
1442 /*set up the member variables*/
1443 This->pShellBrowser = psb;
1444 This->FolderSettings = *lpfs;
1446 /*get our parent window*/
1447 IShellBrowser_AddRef(This->pShellBrowser);
1448 IShellBrowser_GetWindow(This->pShellBrowser, &(This->hWndParent));
1450 /* try to get the ICommDlgBrowserInterface, adds a reference !!! */
1451 This->pCommDlgBrowser=NULL;
1452 if ( SUCCEEDED (IShellBrowser_QueryInterface( This->pShellBrowser,
1453 (REFIID)&IID_ICommDlgBrowser, (LPVOID*) &This->pCommDlgBrowser)))
1455 TRACE("-- CommDlgBrowser\n");
1458 /*if our window class has not been registered, then do so*/
1459 if(!GetClassInfoA(shell32_hInstance, SV_CLASS_NAME, &wc))
1461 ZeroMemory(&wc, sizeof(wc));
1462 wc.style = CS_HREDRAW | CS_VREDRAW;
1463 wc.lpfnWndProc = (WNDPROC) ShellView_WndProc;
1464 wc.cbClsExtra = 0;
1465 wc.cbWndExtra = 0;
1466 wc.hInstance = shell32_hInstance;
1467 wc.hIcon = 0;
1468 wc.hCursor = LoadCursorA (0, IDC_ARROWA);
1469 wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
1470 wc.lpszMenuName = NULL;
1471 wc.lpszClassName = SV_CLASS_NAME;
1473 if(!RegisterClassA(&wc))
1474 return E_FAIL;
1477 *phWnd = CreateWindowExA(0,
1478 SV_CLASS_NAME,
1479 NULL,
1480 WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_TABSTOP,
1481 prcView->left,
1482 prcView->top,
1483 prcView->right - prcView->left,
1484 prcView->bottom - prcView->top,
1485 This->hWndParent,
1487 shell32_hInstance,
1488 (LPVOID)This);
1490 CheckToolbar(This);
1492 if(!*phWnd)
1493 return E_FAIL;
1495 return S_OK;
1498 static HRESULT WINAPI IShellView_fnDestroyViewWindow(IShellView * iface)
1500 ICOM_THIS(IShellViewImpl, iface);
1502 TRACE("(%p)\n",This);
1504 /*Make absolutely sure all our UI is cleaned up.*/
1505 IShellView_UIActivate((IShellView*)This, SVUIA_DEACTIVATE);
1507 if(This->hMenu)
1509 DestroyMenu(This->hMenu);
1512 DestroyWindow(This->hWnd);
1513 IShellBrowser_Release(This->pShellBrowser);
1515 return S_OK;
1518 static HRESULT WINAPI IShellView_fnGetCurrentInfo(IShellView * iface, LPFOLDERSETTINGS lpfs)
1520 ICOM_THIS(IShellViewImpl, iface);
1522 TRACE("(%p)->(%p) vmode=%x flags=%x\n",This, lpfs,
1523 This->FolderSettings.ViewMode, This->FolderSettings.fFlags);
1525 if (!lpfs) return E_INVALIDARG;
1527 *lpfs = This->FolderSettings;
1528 return NOERROR;
1531 static HRESULT WINAPI IShellView_fnAddPropertySheetPages(IShellView * iface, DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam)
1533 ICOM_THIS(IShellViewImpl, iface);
1535 FIXME("(%p) stub\n",This);
1537 return E_NOTIMPL;
1540 static HRESULT WINAPI IShellView_fnSaveViewState(IShellView * iface)
1542 ICOM_THIS(IShellViewImpl, iface);
1544 FIXME("(%p) stub\n",This);
1546 return S_OK;
1549 static HRESULT WINAPI IShellView_fnSelectItem(IShellView * iface, LPCITEMIDLIST pidlItem, UINT uFlags)
1550 { ICOM_THIS(IShellViewImpl, iface);
1552 FIXME("(%p)->(pidl=%p, 0x%08x) stub\n",This, pidlItem, uFlags);
1554 return E_NOTIMPL;
1557 static HRESULT WINAPI IShellView_fnGetItemObject(IShellView * iface, UINT uItem, REFIID riid, LPVOID *ppvOut)
1559 ICOM_THIS(IShellViewImpl, iface);
1561 char xriid[50];
1563 WINE_StringFromCLSID((LPCLSID)riid,xriid);
1564 TRACE("(%p)->(uItem=0x%08x,\n\tIID=%s, ppv=%p)\n",This, uItem, xriid, ppvOut);
1566 *ppvOut = NULL;
1568 switch(uItem)
1570 case SVGIO_BACKGROUND:
1571 *ppvOut = ISvBgCm_Constructor();
1572 break;
1574 case SVGIO_SELECTION:
1575 ShellView_GetSelections(This);
1576 IShellFolder_GetUIObjectOf(This->pSFParent, This->hWnd, This->cidl, This->apidl, riid, 0, ppvOut);
1577 break;
1579 TRACE("-- (%p)->(interface=%p)\n",This, *ppvOut);
1581 if(!*ppvOut) return E_OUTOFMEMORY;
1583 return S_OK;
1586 static struct ICOM_VTABLE(IShellView) svvt =
1588 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1589 IShellView_fnQueryInterface,
1590 IShellView_fnAddRef,
1591 IShellView_fnRelease,
1592 IShellView_fnGetWindow,
1593 IShellView_fnContextSensitiveHelp,
1594 IShellView_fnTranslateAccelerator,
1595 IShellView_fnEnableModeless,
1596 IShellView_fnUIActivate,
1597 IShellView_fnRefresh,
1598 IShellView_fnCreateViewWindow,
1599 IShellView_fnDestroyViewWindow,
1600 IShellView_fnGetCurrentInfo,
1601 IShellView_fnAddPropertySheetPages,
1602 IShellView_fnSaveViewState,
1603 IShellView_fnSelectItem,
1604 IShellView_fnGetItemObject
1608 /**********************************************************
1609 * ISVOleCmdTarget_QueryInterface (IUnknown)
1611 static HRESULT WINAPI ISVOleCmdTarget_QueryInterface(
1612 IOleCommandTarget * iface,
1613 REFIID iid,
1614 LPVOID* ppvObj)
1616 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
1618 return IShellFolder_QueryInterface((IShellFolder*)This, iid, ppvObj);
1621 /**********************************************************
1622 * ISVOleCmdTarget_AddRef (IUnknown)
1624 static ULONG WINAPI ISVOleCmdTarget_AddRef(
1625 IOleCommandTarget * iface)
1627 _ICOM_THIS_From_IOleCommandTarget(IShellFolder, iface);
1629 return IShellFolder_AddRef((IShellFolder*)This);
1632 /**********************************************************
1633 * ISVOleCmdTarget_Release (IUnknown)
1635 static ULONG WINAPI ISVOleCmdTarget_Release(
1636 IOleCommandTarget * iface)
1638 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
1640 return IShellFolder_Release((IShellFolder*)This);
1643 /**********************************************************
1644 * ISVOleCmdTarget_QueryStatus (IOleCommandTarget)
1646 static HRESULT WINAPI ISVOleCmdTarget_QueryStatus(
1647 IOleCommandTarget *iface,
1648 const GUID* pguidCmdGroup,
1649 ULONG cCmds,
1650 OLECMD * prgCmds,
1651 OLECMDTEXT* pCmdText)
1653 char xguid[50];
1655 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
1657 WINE_StringFromCLSID((LPCLSID)pguidCmdGroup,xguid);
1659 FIXME("(%p)->(%p(%s) 0x%08lx %p %p\n", This, pguidCmdGroup, xguid, cCmds, prgCmds, pCmdText);
1660 return E_NOTIMPL;
1663 /**********************************************************
1664 * ISVOleCmdTarget_Exec (IOleCommandTarget)
1666 * nCmdID is the OLECMDID_* enumeration
1668 static HRESULT WINAPI ISVOleCmdTarget_Exec(
1669 IOleCommandTarget *iface,
1670 const GUID* pguidCmdGroup,
1671 DWORD nCmdID,
1672 DWORD nCmdexecopt,
1673 VARIANT* pvaIn,
1674 VARIANT* pvaOut)
1676 char xguid[50];
1678 _ICOM_THIS_From_IOleCommandTarget(IShellViewImpl, iface);
1680 WINE_StringFromCLSID((LPCLSID)pguidCmdGroup,xguid);
1682 FIXME("(%p)->(\n\tTarget GUID:%s Command:0x%08lx Opt:0x%08lx %p %p)\n", This, xguid, nCmdID, nCmdexecopt, pvaIn, pvaOut);
1683 return E_NOTIMPL;
1686 static ICOM_VTABLE(IOleCommandTarget) ctvt =
1688 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1689 ISVOleCmdTarget_QueryInterface,
1690 ISVOleCmdTarget_AddRef,
1691 ISVOleCmdTarget_Release,
1692 ISVOleCmdTarget_QueryStatus,
1693 ISVOleCmdTarget_Exec
1696 /**********************************************************
1697 * ISVDropTarget implementation
1700 static HRESULT WINAPI ISVDropTarget_QueryInterface(
1701 IDropTarget *iface,
1702 REFIID riid,
1703 LPVOID *ppvObj)
1705 char xriid[50];
1707 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1709 WINE_StringFromCLSID((LPCLSID)riid,xriid);
1711 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj);
1713 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
1716 static ULONG WINAPI ISVDropTarget_AddRef( IDropTarget *iface)
1718 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1720 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1722 return IShellFolder_AddRef((IShellFolder*)This);
1725 static ULONG WINAPI ISVDropTarget_Release( IDropTarget *iface)
1727 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1729 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1731 return IShellFolder_Release((IShellFolder*)This);
1734 static HRESULT WINAPI ISVDropTarget_DragEnter(
1735 IDropTarget *iface,
1736 IDataObject *pDataObject,
1737 DWORD grfKeyState,
1738 POINTL pt,
1739 DWORD *pdwEffect)
1742 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1744 FIXME("Stub: This=%p, DataObject=%p\n",This,pDataObject);
1746 return E_NOTIMPL;
1749 static HRESULT WINAPI ISVDropTarget_DragOver(
1750 IDropTarget *iface,
1751 DWORD grfKeyState,
1752 POINTL pt,
1753 DWORD *pdwEffect)
1755 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1757 FIXME("Stub: This=%p\n",This);
1759 return E_NOTIMPL;
1762 static HRESULT WINAPI ISVDropTarget_DragLeave(
1763 IDropTarget *iface)
1765 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1767 FIXME("Stub: This=%p\n",This);
1769 return E_NOTIMPL;
1772 static HRESULT WINAPI ISVDropTarget_Drop(
1773 IDropTarget *iface,
1774 IDataObject* pDataObject,
1775 DWORD grfKeyState,
1776 POINTL pt,
1777 DWORD *pdwEffect)
1779 _ICOM_THIS_From_IDropTarget(IShellViewImpl, iface);
1781 FIXME("Stub: This=%p\n",This);
1783 return E_NOTIMPL;
1786 static struct ICOM_VTABLE(IDropTarget) dtvt =
1788 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1789 ISVDropTarget_QueryInterface,
1790 ISVDropTarget_AddRef,
1791 ISVDropTarget_Release,
1792 ISVDropTarget_DragEnter,
1793 ISVDropTarget_DragOver,
1794 ISVDropTarget_DragLeave,
1795 ISVDropTarget_Drop
1798 /**********************************************************
1799 * ISVDropSource implementation
1802 static HRESULT WINAPI ISVDropSource_QueryInterface(
1803 IDropSource *iface,
1804 REFIID riid,
1805 LPVOID *ppvObj)
1807 char xriid[50];
1809 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
1811 WINE_StringFromCLSID((LPCLSID)riid,xriid);
1813 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj);
1815 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
1818 static ULONG WINAPI ISVDropSource_AddRef( IDropSource *iface)
1820 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
1822 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1824 return IShellFolder_AddRef((IShellFolder*)This);
1827 static ULONG WINAPI ISVDropSource_Release( IDropSource *iface)
1829 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
1831 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1833 return IShellFolder_Release((IShellFolder*)This);
1835 static HRESULT WINAPI ISVDropSource_QueryContinueDrag(
1836 IDropSource *iface,
1837 BOOL fEscapePressed,
1838 DWORD grfKeyState)
1840 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
1841 TRACE("(%p)\n",This);
1843 if (fEscapePressed)
1844 return DRAGDROP_S_CANCEL;
1845 else if (!(grfKeyState & MK_LBUTTON) && !(grfKeyState & MK_RBUTTON))
1846 return DRAGDROP_S_DROP;
1847 else
1848 return NOERROR;
1851 static HRESULT WINAPI ISVDropSource_GiveFeedback(
1852 IDropSource *iface,
1853 DWORD dwEffect)
1855 _ICOM_THIS_From_IDropSource(IShellViewImpl, iface);
1856 TRACE("(%p)\n",This);
1858 return DRAGDROP_S_USEDEFAULTCURSORS;
1861 static struct ICOM_VTABLE(IDropSource) dsvt =
1863 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1864 ISVDropSource_QueryInterface,
1865 ISVDropSource_AddRef,
1866 ISVDropSource_Release,
1867 ISVDropSource_QueryContinueDrag,
1868 ISVDropSource_GiveFeedback
1870 /**********************************************************
1871 * ISVViewObject implementation
1874 static HRESULT WINAPI ISVViewObject_QueryInterface(
1875 IViewObject *iface,
1876 REFIID riid,
1877 LPVOID *ppvObj)
1879 char xriid[50];
1881 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1883 WINE_StringFromCLSID((LPCLSID)riid,xriid);
1885 TRACE("(%p)->(\n\tIID:\t%s,%p)\n",This,xriid,ppvObj);
1887 return IShellFolder_QueryInterface((IShellFolder*)This, riid, ppvObj);
1890 static ULONG WINAPI ISVViewObject_AddRef( IViewObject *iface)
1892 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1894 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1896 return IShellFolder_AddRef((IShellFolder*)This);
1899 static ULONG WINAPI ISVViewObject_Release( IViewObject *iface)
1901 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1903 TRACE("(%p)->(count=%lu)\n",This,This->ref);
1905 return IShellFolder_Release((IShellFolder*)This);
1908 static HRESULT WINAPI ISVViewObject_Draw(
1909 IViewObject *iface,
1910 DWORD dwDrawAspect,
1911 LONG lindex,
1912 void* pvAspect,
1913 DVTARGETDEVICE* ptd,
1914 HDC hdcTargetDev,
1915 HDC hdcDraw,
1916 LPCRECTL lprcBounds,
1917 LPCRECTL lprcWBounds,
1918 IVO_ContCallback pfnContinue,
1919 DWORD dwContinue)
1922 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1924 FIXME("Stub: This=%p\n",This);
1926 return E_NOTIMPL;
1928 static HRESULT WINAPI ISVViewObject_GetColorSet(
1929 IViewObject *iface,
1930 DWORD dwDrawAspect,
1931 LONG lindex,
1932 void *pvAspect,
1933 DVTARGETDEVICE* ptd,
1934 HDC hicTargetDevice,
1935 LOGPALETTE** ppColorSet)
1938 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1940 FIXME("Stub: This=%p\n",This);
1942 return E_NOTIMPL;
1944 static HRESULT WINAPI ISVViewObject_Freeze(
1945 IViewObject *iface,
1946 DWORD dwDrawAspect,
1947 LONG lindex,
1948 void* pvAspect,
1949 DWORD* pdwFreeze)
1952 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1954 FIXME("Stub: This=%p\n",This);
1956 return E_NOTIMPL;
1958 static HRESULT WINAPI ISVViewObject_Unfreeze(
1959 IViewObject *iface,
1960 DWORD dwFreeze)
1963 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1965 FIXME("Stub: This=%p\n",This);
1967 return E_NOTIMPL;
1969 static HRESULT WINAPI ISVViewObject_SetAdvise(
1970 IViewObject *iface,
1971 DWORD aspects,
1972 DWORD advf,
1973 IAdviseSink* pAdvSink)
1976 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1978 FIXME("Stub: This=%p\n",This);
1980 return E_NOTIMPL;
1982 static HRESULT WINAPI ISVViewObject_GetAdvise(
1983 IViewObject *iface,
1984 DWORD* pAspects,
1985 DWORD* pAdvf,
1986 IAdviseSink** ppAdvSink)
1989 _ICOM_THIS_From_IViewObject(IShellViewImpl, iface);
1991 FIXME("Stub: This=%p\n",This);
1993 return E_NOTIMPL;
1997 static struct ICOM_VTABLE(IViewObject) vovt =
1999 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2000 ISVViewObject_QueryInterface,
2001 ISVViewObject_AddRef,
2002 ISVViewObject_Release,
2003 ISVViewObject_Draw,
2004 ISVViewObject_GetColorSet,
2005 ISVViewObject_Freeze,
2006 ISVViewObject_Unfreeze,
2007 ISVViewObject_SetAdvise,
2008 ISVViewObject_GetAdvise