2 * Implementation of IShellBrowser for the File Open common dialog
14 #include "debugtools.h"
16 #include "filedlgbrowser.h"
19 #include "wine/obj_serviceprovider.h"
21 DEFAULT_DEBUG_CHANNEL(commdlg);
26 ICOM_VTABLE(IShellBrowser) * lpVtbl;
27 ICOM_VTABLE(ICommDlgBrowser) * lpVtblCommDlgBrowser;
28 ICOM_VTABLE(IServiceProvider)* lpVtblServiceProvider;
29 DWORD ref; /* Reference counter */
30 HWND hwndOwner; /* Owner dialog of the interface */
34 /**************************************************************************
37 static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl;
38 static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl;
39 static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl;
41 /**************************************************************************
45 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv);
47 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
50 /**************************************************************************
53 extern const char *FileOpenDlgInfosStr;
55 extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName);
56 extern HRESULT GetFileName(HWND hwnd, LPITEMIDLIST pidl, LPSTR lpstrFileName);
57 extern IShellFolder* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs);
58 extern LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl);
59 extern LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName);
61 extern BOOL FILEDLG95_SHELL_FillIncludedItemList(HWND hwnd,
62 LPITEMIDLIST pidlCurrentFolder,
65 extern int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl);
66 extern BOOL FILEDLG95_OnOpen(HWND hwnd);
67 extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
74 static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
76 char lpstrPath[MAX_PATH];
77 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
78 SetCurrentDirectoryA(lpstrPath);
79 TRACE("new current folder %s\n", lpstrPath);
82 /* copied from shell32 to avoid linking to it */
83 static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
85 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
90 lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
91 COMDLG32_SHFree(src->u.pOleStr);
95 if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
96 ((LPWSTR)dest)[len-1] = 0;
102 if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
103 -1, (LPWSTR)dest, len ))
104 ((LPWSTR)dest)[len-1] = 0;
109 FIXME("unknown type!\n");
111 { *(LPWSTR)dest = '\0';
122 /**************************************************************************
123 * IShellBrowserImpl_Construct
125 IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
127 IShellBrowserImpl *sb;
128 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr);
130 sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
132 /* Initialisation of the member variables */
134 sb->hwndOwner = hwndOwner;
136 /* Initialisation of the vTables */
137 sb->lpVtbl = &IShellBrowserImpl_Vtbl;
138 sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
139 sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
140 COMDLG32_SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
141 &fodInfos->ShellInfos.pidlAbsCurrent);
145 return (IShellBrowser *) sb;
148 /***************************************************************************
149 * IShellBrowserImpl_QueryInterface
151 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
155 ICOM_THIS(IShellBrowserImpl, iface);
157 TRACE("(%p)\n\t%s\n", This, debugstr_guid(riid));
161 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
164 else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/
165 { *ppvObj = (IOleWindow*)This;
168 else if(IsEqualIID(riid, &IID_IShellBrowser)) /*IShellBrowser*/
169 { *ppvObj = (IShellBrowser*)This;
172 else if(IsEqualIID(riid, &IID_ICommDlgBrowser)) /*ICommDlgBrowser*/
173 { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblCommDlgBrowser);
176 else if(IsEqualIID(riid, &IID_IServiceProvider)) /* IServiceProvider */
177 { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblServiceProvider);
181 { IUnknown_AddRef( (IShellBrowser*) *ppvObj);
184 FIXME("Unknown interface requested\n");
185 return E_NOINTERFACE;
188 /**************************************************************************
189 * IShellBrowser::AddRef
191 ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
193 ICOM_THIS(IShellBrowserImpl, iface);
195 TRACE("(%p)\n", This);
197 return ++(This->ref);
200 /**************************************************************************
201 * IShellBrowserImpl_Release
203 ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
205 ICOM_THIS(IShellBrowserImpl, iface);
207 TRACE("(%p)\n", This);
211 HeapFree(GetProcessHeap(),0, This);
221 /**************************************************************************
222 * IShellBrowserImpl_GetWindow (IOleWindow)
224 * Inherited from IOleWindow::GetWindow
226 * See Windows documentation for more details
228 * Note : We will never be window less in the File Open dialog
231 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
234 ICOM_THIS(IShellBrowserImpl, iface);
236 TRACE("(%p)\n", This);
241 *phwnd = This->hwndOwner;
243 return (*phwnd) ? S_OK : E_UNEXPECTED;
247 /**************************************************************************
248 * IShellBrowserImpl_ContextSensitiveHelp
250 HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
253 ICOM_THIS(IShellBrowserImpl, iface);
255 TRACE("(%p)\n", This);
257 /* Feature not implemented */
265 /**************************************************************************
266 * IShellBrowserImpl_BrowseObject
268 * See Windows documentation on IShellBrowser::BrowseObject for more details
270 * This function will override user specified flags and will always
271 * use SBSP_DEFBROWSER and SBSP_DEFMODE.
273 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
278 IShellFolder *psfTmp;
280 FileOpenDlgInfos *fodInfos;
281 LPITEMIDLIST pidlTmp;
286 ICOM_THIS(IShellBrowserImpl, iface);
288 TRACE("(%p)(%p,0x%08x)\n", This, pidl, wFlags);
290 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
292 /* Format the pidl according to its parameter's category */
293 if(wFlags & SBSP_RELATIVE)
296 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */
297 if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
298 pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp)))
300 ERR("bind to object failed\n");
303 /* create an absolute pidl */
304 pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
307 else if(wFlags & SBSP_PARENT)
309 /* Browse the parent folder (ignores the pidl) */
310 pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
311 psfTmp = GetShellFolderFromPidl(pidlTmp);
314 else /* SBSP_ABSOLUTE is 0x0000 */
316 /* An absolute pidl (relative from the desktop) */
317 pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl);
318 psfTmp = GetShellFolderFromPidl(pidlTmp);
323 ERR("could not browse to folder\n");
327 /* If the pidl to browse to is equal to the actual pidl ...
328 do nothing and pretend you did it*/
329 if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
331 IShellFolder_Release(psfTmp);
332 COMDLG32_SHFree(pidlTmp);
333 TRACE("keep current folder\n");
337 /* Release the current DataObject */
338 if (fodInfos->Shell.FOIDataObject)
340 IDataObject_Release(fodInfos->Shell.FOIDataObject);
341 fodInfos->Shell.FOIDataObject = NULL;
344 /* Create the associated view */
345 TRACE("create view object\n");
346 if(FAILED(hRes = IShellFolder_CreateViewObject(psfTmp, fodInfos->ShellInfos.hwndOwner,
347 &IID_IShellView, (LPVOID *)&psvTmp))) goto error;
349 /* Check if listview has focus */
350 bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
352 /* Get the foldersettings from the old view */
353 if(fodInfos->Shell.FOIShellView)
354 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
356 /* Release the old fodInfos->Shell.FOIShellView and update its value.
357 We have to update this early since ShellView_CreateViewWindow of native
358 shell32 calls OnStateChange and needs the correct view here.*/
359 if(fodInfos->Shell.FOIShellView)
361 IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
362 IShellView_Release(fodInfos->Shell.FOIShellView);
364 fodInfos->Shell.FOIShellView = psvTmp;
366 /* Release old FOIShellFolder and update its value */
367 if (fodInfos->Shell.FOIShellFolder)
368 IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
369 fodInfos->Shell.FOIShellFolder = psfTmp;
371 /* Release old pidlAbsCurrent and update its value */
372 COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
373 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
375 COMDLG32_UpdateCurrentDir(fodInfos);
377 /* Create the window */
378 TRACE("create view window\n");
379 if(FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
380 &fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
381 &fodInfos->ShellInfos.rectView, &hwndView))) goto error;
383 fodInfos->ShellInfos.hwndView = hwndView;
385 /* Select the new folder in the Look In combo box of the Open file dialog */
386 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
388 /* changes the tab order of the ListView to reflect the window's File Dialog */
389 hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
390 SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
392 /* Since we destroyed the old view if it had focus set focus to the newly created view */
394 SetFocus(fodInfos->ShellInfos.hwndView);
398 ERR("Failed with error 0x%08lx\n", hRes);
402 /**************************************************************************
403 * IShellBrowserImpl_EnableModelessSB
405 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
409 ICOM_THIS(IShellBrowserImpl, iface);
411 TRACE("(%p)\n", This);
413 /* Feature not implemented */
417 /**************************************************************************
418 * IShellBrowserImpl_GetControlWindow
420 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
425 ICOM_THIS(IShellBrowserImpl, iface);
427 TRACE("(%p)\n", This);
429 /* Feature not implemented */
432 /**************************************************************************
433 * IShellBrowserImpl_GetViewStateStream
435 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
440 ICOM_THIS(IShellBrowserImpl, iface);
442 FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
444 /* Feature not implemented */
447 /**************************************************************************
448 * IShellBrowserImpl_InsertMenusSB
450 HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
452 LPOLEMENUGROUPWIDTHS lpMenuWidths)
455 ICOM_THIS(IShellBrowserImpl, iface);
457 TRACE("(%p)\n", This);
459 /* Feature not implemented */
462 /**************************************************************************
463 * IShellBrowserImpl_OnViewWindowActive
465 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
469 ICOM_THIS(IShellBrowserImpl, iface);
471 TRACE("(%p)\n", This);
473 /* Feature not implemented */
476 /**************************************************************************
477 * IShellBrowserImpl_QueryActiveShellView
479 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
483 ICOM_THIS(IShellBrowserImpl, iface);
485 FileOpenDlgInfos *fodInfos;
487 TRACE("(%p)\n", This);
489 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
491 if(!(*ppshv = fodInfos->Shell.FOIShellView))
495 IShellView_AddRef(fodInfos->Shell.FOIShellView);
498 /**************************************************************************
499 * IShellBrowserImpl_RemoveMenusSB
501 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
505 ICOM_THIS(IShellBrowserImpl, iface);
507 TRACE("(%p)\n", This);
509 /* Feature not implemented */
512 /**************************************************************************
513 * IShellBrowserImpl_SendControlMsg
515 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
523 ICOM_THIS(IShellBrowserImpl, iface);
526 TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
531 lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
534 FIXME("ctrl id: %x\n", id);
537 if (pret) *pret = lres;
540 /**************************************************************************
541 * IShellBrowserImpl_SetMenuSB
543 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
545 HOLEMENU holemenuReserved,
546 HWND hwndActiveObject)
549 ICOM_THIS(IShellBrowserImpl, iface);
551 TRACE("(%p)\n", This);
553 /* Feature not implemented */
556 /**************************************************************************
557 * IShellBrowserImpl_SetStatusTextSB
559 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
560 LPCOLESTR lpszStatusText)
563 ICOM_THIS(IShellBrowserImpl, iface);
565 TRACE("(%p)\n", This);
567 /* Feature not implemented */
570 /**************************************************************************
571 * IShellBrowserImpl_SetToolbarItems
573 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
574 LPTBBUTTON lpButtons,
579 ICOM_THIS(IShellBrowserImpl, iface);
581 TRACE("(%p)\n", This);
583 /* Feature not implemented */
586 /**************************************************************************
587 * IShellBrowserImpl_TranslateAcceleratorSB
589 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
594 ICOM_THIS(IShellBrowserImpl, iface);
596 TRACE("(%p)\n", This);
598 /* Feature not implemented */
602 static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl =
604 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
606 IShellBrowserImpl_QueryInterface,
607 IShellBrowserImpl_AddRef,
608 IShellBrowserImpl_Release,
610 IShellBrowserImpl_GetWindow,
611 IShellBrowserImpl_ContextSensitiveHelp,
613 IShellBrowserImpl_InsertMenusSB,
614 IShellBrowserImpl_SetMenuSB,
615 IShellBrowserImpl_RemoveMenusSB,
616 IShellBrowserImpl_SetStatusTextSB,
617 IShellBrowserImpl_EnableModelessSB,
618 IShellBrowserImpl_TranslateAcceleratorSB,
619 IShellBrowserImpl_BrowseObject,
620 IShellBrowserImpl_GetViewStateStream,
621 IShellBrowserImpl_GetControlWindow,
622 IShellBrowserImpl_SendControlMsg,
623 IShellBrowserImpl_QueryActiveShellView,
624 IShellBrowserImpl_OnViewWindowActive,
625 IShellBrowserImpl_SetToolbarItems
634 /***************************************************************************
635 * IShellBrowserImpl_ICommDlgBrowser_QueryInterface
637 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
638 ICommDlgBrowser *iface,
642 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
644 TRACE("(%p)\n", This);
646 return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
649 /**************************************************************************
650 * IShellBrowserImpl_ICommDlgBrowser_AddRef
652 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
654 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
656 TRACE("(%p)\n", This);
658 return IShellBrowserImpl_AddRef(This);
661 /**************************************************************************
662 * IShellBrowserImpl_ICommDlgBrowser_Release
664 ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
666 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
668 TRACE("(%p)\n", This);
670 return IShellBrowserImpl_Release(This);
672 /**************************************************************************
673 * IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
675 * Called when a user double-clicks in the view or presses the ENTER key
677 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
681 FileOpenDlgInfos *fodInfos;
683 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
685 TRACE("(%p)\n", This);
687 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
689 /* If the selected object is not a folder, send a IDOK command to parent window */
690 if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
694 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
695 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
696 if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
698 hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE);
702 /* Tell the dialog that the user selected a file */
703 hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
706 /* Free memory used by pidl */
707 COMDLG32_SHFree((LPVOID)pidl);
715 /**************************************************************************
716 * IShellBrowserImpl_ICommDlgBrowser_OnStateChange
718 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
723 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
725 TRACE("(%p shv=%p)\n", This, ppshv);
729 case CDBOSC_SETFOCUS:
730 /* FIXME: Reset the default button.
731 This should be taken care of by defdlg. If control
732 other than button receives focus the default button
733 should be restored. */
734 SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
737 case CDBOSC_KILLFOCUS:
739 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
740 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
741 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
744 case CDBOSC_SELCHANGE:
745 return IShellBrowserImpl_ICommDlgBrowser_OnSelChange(iface,ppshv);
754 /**************************************************************************
755 * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
757 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
761 FileOpenDlgInfos *fodInfos;
764 WCHAR szPathW[MAX_PATH];
766 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
768 TRACE("(%p)\n", This);
770 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
772 ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
773 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
775 if( (ulAttr & SFGAO_HIDDEN) /* hidden */
776 | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
779 /* always include directorys and links */
780 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
783 /* Check if there is a mask to apply if not */
784 if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
787 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
789 if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
791 if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
799 /**************************************************************************
800 * IShellBrowserImpl_ICommDlgBrowser_OnSelChange
802 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv)
804 FileOpenDlgInfos *fodInfos;
806 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
808 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
809 TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
811 /* release old selections */
812 if (fodInfos->Shell.FOIDataObject)
813 IDataObject_Release(fodInfos->Shell.FOIDataObject);
815 /* get a new DataObject from the ShellView */
816 if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
817 &IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject)))
820 FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
822 SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
826 static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
828 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
830 IShellBrowserImpl_ICommDlgBrowser_QueryInterface,
831 IShellBrowserImpl_ICommDlgBrowser_AddRef,
832 IShellBrowserImpl_ICommDlgBrowser_Release,
833 /* ICommDlgBrowser */
834 IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand,
835 IShellBrowserImpl_ICommDlgBrowser_OnStateChange,
836 IShellBrowserImpl_ICommDlgBrowser_IncludeObject
846 /***************************************************************************
847 * IShellBrowserImpl_IServiceProvider_QueryInterface
849 HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
850 IServiceProvider *iface,
854 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
856 FIXME("(%p)\n", This);
858 return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
861 /**************************************************************************
862 * IShellBrowserImpl_IServiceProvider_AddRef
864 ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
866 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
868 FIXME("(%p)\n", This);
870 return IShellBrowserImpl_AddRef(This);
873 /**************************************************************************
874 * IShellBrowserImpl_IServiceProvider_Release
876 ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
878 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
880 FIXME("(%p)\n", This);
882 return IShellBrowserImpl_Release(This);
885 /**************************************************************************
886 * IShellBrowserImpl_IServiceProvider_Release
889 * the w2k shellview asks for
890 * guidService = SID_STopLevelBrowser
891 * riid = IShellBrowser
897 HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
898 IServiceProvider * iface,
903 _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
905 FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
908 if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
910 return IShellBrowserImpl_QueryInterface(This,riid,ppv);
912 FIXME("(%p) unknown interface requested\n", This);
913 return E_NOINTERFACE;
917 static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl =
919 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
921 IShellBrowserImpl_IServiceProvider_QueryInterface,
922 IShellBrowserImpl_IServiceProvider_AddRef,
923 IShellBrowserImpl_IServiceProvider_Release,
924 /* IServiceProvider */
925 IShellBrowserImpl_IServiceProvider_QueryService