2 * Implementation of IShellBrowser for the File Open common dialog
17 #define NO_SHLWAPI_STREAM
19 #include "filedlgbrowser.h"
22 #include "wine/obj_serviceprovider.h"
23 #include "debugtools.h"
25 DEFAULT_DEBUG_CHANNEL(commdlg);
30 ICOM_VTABLE(IShellBrowser) * lpVtbl;
31 ICOM_VTABLE(ICommDlgBrowser) * lpVtblCommDlgBrowser;
32 ICOM_VTABLE(IServiceProvider)* lpVtblServiceProvider;
33 DWORD ref; /* Reference counter */
34 HWND hwndOwner; /* Owner dialog of the interface */
38 /**************************************************************************
41 static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl;
42 static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl;
43 static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl;
45 /**************************************************************************
49 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv);
51 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
54 /**************************************************************************
57 extern const char *FileOpenDlgInfosStr;
59 extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName);
60 extern HRESULT GetFileName(HWND hwnd, LPITEMIDLIST pidl, LPSTR lpstrFileName);
61 extern IShellFolder* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs);
62 extern LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl);
63 extern LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName);
65 extern BOOL FILEDLG95_SHELL_FillIncludedItemList(HWND hwnd,
66 LPITEMIDLIST pidlCurrentFolder,
69 extern int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl);
70 extern BOOL FILEDLG95_OnOpen(HWND hwnd);
71 extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
78 static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
80 char lpstrPath[MAX_PATH];
81 SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
82 SetCurrentDirectoryA(lpstrPath);
83 TRACE("new current folder %s\n", lpstrPath);
86 /* copied from shell32 to avoid linking to it */
87 static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
89 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
94 lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
95 COMDLG32_SHFree(src->u.pOleStr);
99 if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
100 ((LPWSTR)dest)[len-1] = 0;
106 if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
107 -1, (LPWSTR)dest, len ))
108 ((LPWSTR)dest)[len-1] = 0;
113 FIXME("unknown type!\n");
115 { *(LPWSTR)dest = '\0';
126 /**************************************************************************
127 * IShellBrowserImpl_Construct
129 IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
131 IShellBrowserImpl *sb;
132 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr);
134 sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
136 /* Initialisation of the member variables */
138 sb->hwndOwner = hwndOwner;
140 /* Initialisation of the vTables */
141 sb->lpVtbl = &IShellBrowserImpl_Vtbl;
142 sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
143 sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
144 SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
145 &fodInfos->ShellInfos.pidlAbsCurrent);
149 return (IShellBrowser *) sb;
152 /***************************************************************************
153 * IShellBrowserImpl_QueryInterface
155 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
159 ICOM_THIS(IShellBrowserImpl, iface);
161 TRACE("(%p)\n\t%s\n", This, debugstr_guid(riid));
165 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
168 else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/
169 { *ppvObj = (IOleWindow*)This;
172 else if(IsEqualIID(riid, &IID_IShellBrowser)) /*IShellBrowser*/
173 { *ppvObj = (IShellBrowser*)This;
176 else if(IsEqualIID(riid, &IID_ICommDlgBrowser)) /*ICommDlgBrowser*/
177 { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblCommDlgBrowser);
180 else if(IsEqualIID(riid, &IID_IServiceProvider)) /* IServiceProvider */
181 { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblServiceProvider);
185 { IUnknown_AddRef( (IShellBrowser*) *ppvObj);
188 FIXME("Unknown interface requested\n");
189 return E_NOINTERFACE;
192 /**************************************************************************
193 * IShellBrowser::AddRef
195 ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
197 ICOM_THIS(IShellBrowserImpl, iface);
199 TRACE("(%p)\n", This);
201 return ++(This->ref);
204 /**************************************************************************
205 * IShellBrowserImpl_Release
207 ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
209 ICOM_THIS(IShellBrowserImpl, iface);
211 TRACE("(%p)\n", This);
215 HeapFree(GetProcessHeap(),0, This);
225 /**************************************************************************
226 * IShellBrowserImpl_GetWindow (IOleWindow)
228 * Inherited from IOleWindow::GetWindow
230 * See Windows documentation for more details
232 * Note : We will never be window less in the File Open dialog
235 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
238 ICOM_THIS(IShellBrowserImpl, iface);
240 TRACE("(%p)\n", This);
245 *phwnd = This->hwndOwner;
247 return (*phwnd) ? S_OK : E_UNEXPECTED;
251 /**************************************************************************
252 * IShellBrowserImpl_ContextSensitiveHelp
254 HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
257 ICOM_THIS(IShellBrowserImpl, iface);
259 TRACE("(%p)\n", This);
261 /* Feature not implemented */
269 /**************************************************************************
270 * IShellBrowserImpl_BrowseObject
272 * See Windows documentation on IShellBrowser::BrowseObject for more details
274 * This function will override user specified flags and will always
275 * use SBSP_DEFBROWSER and SBSP_DEFMODE.
277 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
282 IShellFolder *psfTmp;
284 FileOpenDlgInfos *fodInfos;
285 LPITEMIDLIST pidlTmp;
290 ICOM_THIS(IShellBrowserImpl, iface);
292 TRACE("(%p)(%p,0x%08x)\n", This, pidl, wFlags);
294 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
296 /* Format the pidl according to its parameter's category */
297 if(wFlags & SBSP_RELATIVE)
300 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */
301 if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
302 pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp)))
304 ERR("bind to object failed\n");
307 /* create an absolute pidl */
308 pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
311 else if(wFlags & SBSP_PARENT)
313 /* Browse the parent folder (ignores the pidl) */
314 pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
315 psfTmp = GetShellFolderFromPidl(pidlTmp);
318 else /* SBSP_ABSOLUTE is 0x0000 */
320 /* An absolute pidl (relative from the desktop) */
321 pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl);
322 psfTmp = GetShellFolderFromPidl(pidlTmp);
327 ERR("could not browse to folder\n");
331 /* If the pidl to browse to is equal to the actual pidl ...
332 do nothing and pretend you did it*/
333 if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
335 IShellFolder_Release(psfTmp);
336 COMDLG32_SHFree(pidlTmp);
337 TRACE("keep current folder\n");
341 /* Release the current DataObject */
342 if (fodInfos->Shell.FOIDataObject)
344 IDataObject_Release(fodInfos->Shell.FOIDataObject);
345 fodInfos->Shell.FOIDataObject = NULL;
348 /* Create the associated view */
349 TRACE("create view object\n");
350 if(FAILED(hRes = IShellFolder_CreateViewObject(psfTmp, fodInfos->ShellInfos.hwndOwner,
351 &IID_IShellView, (LPVOID *)&psvTmp))) goto error;
353 /* Check if listview has focus */
354 bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
356 /* Get the foldersettings from the old view */
357 if(fodInfos->Shell.FOIShellView)
358 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
360 /* Release the old fodInfos->Shell.FOIShellView and update its value.
361 We have to update this early since ShellView_CreateViewWindow of native
362 shell32 calls OnStateChange and needs the correct view here.*/
363 if(fodInfos->Shell.FOIShellView)
365 IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
366 IShellView_Release(fodInfos->Shell.FOIShellView);
368 fodInfos->Shell.FOIShellView = psvTmp;
370 /* Release old FOIShellFolder and update its value */
371 if (fodInfos->Shell.FOIShellFolder)
372 IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
373 fodInfos->Shell.FOIShellFolder = psfTmp;
375 /* Release old pidlAbsCurrent and update its value */
376 COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
377 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
379 COMDLG32_UpdateCurrentDir(fodInfos);
381 /* Create the window */
382 TRACE("create view window\n");
383 if(FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
384 &fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
385 &fodInfos->ShellInfos.rectView, &hwndView))) goto error;
387 fodInfos->ShellInfos.hwndView = hwndView;
389 /* Select the new folder in the Look In combo box of the Open file dialog */
390 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
392 /* changes the tab order of the ListView to reflect the window's File Dialog */
393 hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
394 SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
396 /* Since we destroyed the old view if it had focus set focus to the newly created view */
398 SetFocus(fodInfos->ShellInfos.hwndView);
402 ERR("Failed with error 0x%08lx\n", hRes);
406 /**************************************************************************
407 * IShellBrowserImpl_EnableModelessSB
409 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
413 ICOM_THIS(IShellBrowserImpl, iface);
415 TRACE("(%p)\n", This);
417 /* Feature not implemented */
421 /**************************************************************************
422 * IShellBrowserImpl_GetControlWindow
424 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
429 ICOM_THIS(IShellBrowserImpl, iface);
431 TRACE("(%p)\n", This);
433 /* Feature not implemented */
436 /**************************************************************************
437 * IShellBrowserImpl_GetViewStateStream
439 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
444 ICOM_THIS(IShellBrowserImpl, iface);
446 FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
448 /* Feature not implemented */
451 /**************************************************************************
452 * IShellBrowserImpl_InsertMenusSB
454 HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
456 LPOLEMENUGROUPWIDTHS lpMenuWidths)
459 ICOM_THIS(IShellBrowserImpl, iface);
461 TRACE("(%p)\n", This);
463 /* Feature not implemented */
466 /**************************************************************************
467 * IShellBrowserImpl_OnViewWindowActive
469 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
473 ICOM_THIS(IShellBrowserImpl, iface);
475 TRACE("(%p)\n", This);
477 /* Feature not implemented */
480 /**************************************************************************
481 * IShellBrowserImpl_QueryActiveShellView
483 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
487 ICOM_THIS(IShellBrowserImpl, iface);
489 FileOpenDlgInfos *fodInfos;
491 TRACE("(%p)\n", This);
493 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
495 if(!(*ppshv = fodInfos->Shell.FOIShellView))
499 IShellView_AddRef(fodInfos->Shell.FOIShellView);
502 /**************************************************************************
503 * IShellBrowserImpl_RemoveMenusSB
505 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
509 ICOM_THIS(IShellBrowserImpl, iface);
511 TRACE("(%p)\n", This);
513 /* Feature not implemented */
516 /**************************************************************************
517 * IShellBrowserImpl_SendControlMsg
519 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
527 ICOM_THIS(IShellBrowserImpl, iface);
530 TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
535 lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
538 FIXME("ctrl id: %x\n", id);
541 if (pret) *pret = lres;
544 /**************************************************************************
545 * IShellBrowserImpl_SetMenuSB
547 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
549 HOLEMENU holemenuReserved,
550 HWND hwndActiveObject)
553 ICOM_THIS(IShellBrowserImpl, iface);
555 TRACE("(%p)\n", This);
557 /* Feature not implemented */
560 /**************************************************************************
561 * IShellBrowserImpl_SetStatusTextSB
563 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
564 LPCOLESTR lpszStatusText)
567 ICOM_THIS(IShellBrowserImpl, iface);
569 TRACE("(%p)\n", This);
571 /* Feature not implemented */
574 /**************************************************************************
575 * IShellBrowserImpl_SetToolbarItems
577 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
578 LPTBBUTTON lpButtons,
583 ICOM_THIS(IShellBrowserImpl, iface);
585 TRACE("(%p)\n", This);
587 /* Feature not implemented */
590 /**************************************************************************
591 * IShellBrowserImpl_TranslateAcceleratorSB
593 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
598 ICOM_THIS(IShellBrowserImpl, iface);
600 TRACE("(%p)\n", This);
602 /* Feature not implemented */
606 static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl =
608 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
610 IShellBrowserImpl_QueryInterface,
611 IShellBrowserImpl_AddRef,
612 IShellBrowserImpl_Release,
614 IShellBrowserImpl_GetWindow,
615 IShellBrowserImpl_ContextSensitiveHelp,
617 IShellBrowserImpl_InsertMenusSB,
618 IShellBrowserImpl_SetMenuSB,
619 IShellBrowserImpl_RemoveMenusSB,
620 IShellBrowserImpl_SetStatusTextSB,
621 IShellBrowserImpl_EnableModelessSB,
622 IShellBrowserImpl_TranslateAcceleratorSB,
623 IShellBrowserImpl_BrowseObject,
624 IShellBrowserImpl_GetViewStateStream,
625 IShellBrowserImpl_GetControlWindow,
626 IShellBrowserImpl_SendControlMsg,
627 IShellBrowserImpl_QueryActiveShellView,
628 IShellBrowserImpl_OnViewWindowActive,
629 IShellBrowserImpl_SetToolbarItems
638 /***************************************************************************
639 * IShellBrowserImpl_ICommDlgBrowser_QueryInterface
641 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
642 ICommDlgBrowser *iface,
646 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
648 TRACE("(%p)\n", This);
650 return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
653 /**************************************************************************
654 * IShellBrowserImpl_ICommDlgBrowser_AddRef
656 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
658 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
660 TRACE("(%p)\n", This);
662 return IShellBrowserImpl_AddRef(This);
665 /**************************************************************************
666 * IShellBrowserImpl_ICommDlgBrowser_Release
668 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
670 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
672 TRACE("(%p)\n", This);
674 return IShellBrowserImpl_Release(This);
676 /**************************************************************************
677 * IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
679 * Called when a user double-clicks in the view or presses the ENTER key
681 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
685 FileOpenDlgInfos *fodInfos;
687 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
689 TRACE("(%p)\n", This);
691 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
693 /* If the selected object is not a folder, send a IDOK command to parent window */
694 if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
698 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
699 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
700 if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
702 hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE);
706 /* Tell the dialog that the user selected a file */
707 hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
710 /* Free memory used by pidl */
711 COMDLG32_SHFree((LPVOID)pidl);
719 /**************************************************************************
720 * IShellBrowserImpl_ICommDlgBrowser_OnStateChange
722 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
727 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
729 TRACE("(%p shv=%p)\n", This, ppshv);
733 case CDBOSC_SETFOCUS:
734 /* FIXME: Reset the default button.
735 This should be taken care of by defdlg. If control
736 other than button receives focus the default button
737 should be restored. */
738 SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
741 case CDBOSC_KILLFOCUS:
743 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
744 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
745 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
748 case CDBOSC_SELCHANGE:
749 return IShellBrowserImpl_ICommDlgBrowser_OnSelChange(iface,ppshv);
758 /**************************************************************************
759 * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
761 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
765 FileOpenDlgInfos *fodInfos;
768 WCHAR szPathW[MAX_PATH];
770 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
772 TRACE("(%p)\n", This);
774 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
776 ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
777 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
779 if( (ulAttr & SFGAO_HIDDEN) /* hidden */
780 | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
783 /* always include directories and links */
784 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
787 /* Check if there is a mask to apply if not */
788 if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
791 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
793 if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
795 if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
803 /**************************************************************************
804 * IShellBrowserImpl_ICommDlgBrowser_OnSelChange
806 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv)
808 FileOpenDlgInfos *fodInfos;
810 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
812 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
813 TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
815 /* release old selections */
816 if (fodInfos->Shell.FOIDataObject)
817 IDataObject_Release(fodInfos->Shell.FOIDataObject);
819 /* get a new DataObject from the ShellView */
820 if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
821 &IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject)))
824 FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
826 SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
830 static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
832 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
834 IShellBrowserImpl_ICommDlgBrowser_QueryInterface,
835 IShellBrowserImpl_ICommDlgBrowser_AddRef,
836 IShellBrowserImpl_ICommDlgBrowser_Release,
837 /* ICommDlgBrowser */
838 IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand,
839 IShellBrowserImpl_ICommDlgBrowser_OnStateChange,
840 IShellBrowserImpl_ICommDlgBrowser_IncludeObject
850 /***************************************************************************
851 * IShellBrowserImpl_IServiceProvider_QueryInterface
853 HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
854 IServiceProvider *iface,
858 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
860 FIXME("(%p)\n", This);
862 return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
865 /**************************************************************************
866 * IShellBrowserImpl_IServiceProvider_AddRef
868 ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
870 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
872 FIXME("(%p)\n", This);
874 return IShellBrowserImpl_AddRef(This);
877 /**************************************************************************
878 * IShellBrowserImpl_IServiceProvider_Release
880 ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
882 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
884 FIXME("(%p)\n", This);
886 return IShellBrowserImpl_Release(This);
889 /**************************************************************************
890 * IShellBrowserImpl_IServiceProvider_Release
893 * the w2k shellview asks for
894 * guidService = SID_STopLevelBrowser
895 * riid = IShellBrowser
901 HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
902 IServiceProvider * iface,
907 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
909 FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
912 if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
914 return IShellBrowserImpl_QueryInterface(This,riid,ppv);
916 FIXME("(%p) unknown interface requested\n", This);
917 return E_NOINTERFACE;
921 static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl =
923 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
925 IShellBrowserImpl_IServiceProvider_QueryInterface,
926 IShellBrowserImpl_IServiceProvider_AddRef,
927 IShellBrowserImpl_IServiceProvider_Release,
928 /* IServiceProvider */
929 IShellBrowserImpl_IServiceProvider_QueryService