2 * Implementation of IShellBrowser for the File Open common dialog
12 #include "wine/winestring.h"
14 #include "debugtools.h"
19 #include "filedlgbrowser.h"
22 #include "wine/obj_serviceprovider.h"
24 DEFAULT_DEBUG_CHANNEL(commdlg
);
29 ICOM_VTABLE(IShellBrowser
) * lpVtbl
;
30 ICOM_VTABLE(ICommDlgBrowser
) * lpVtblCommDlgBrowser
;
31 ICOM_VTABLE(IServiceProvider
)* lpVtblServiceProvider
;
32 DWORD ref
; /* Reference counter */
33 HWND hwndOwner
; /* Owner dialog of the interface */
37 /**************************************************************************
40 static ICOM_VTABLE(IShellBrowser
) IShellBrowserImpl_Vtbl
;
41 static ICOM_VTABLE(ICommDlgBrowser
) IShellBrowserImpl_ICommDlgBrowser_Vtbl
;
42 static ICOM_VTABLE(IServiceProvider
) IShellBrowserImpl_IServiceProvider_Vtbl
;
44 /**************************************************************************
48 HRESULT
IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser
*iface
, IShellView
*ppshv
);
50 LPITEMIDLIST
GetSelectedPidl(IShellView
*ppshv
);
53 /**************************************************************************
56 extern const char *FileOpenDlgInfosStr
;
58 extern HRESULT
GetName(LPSHELLFOLDER lpsf
, LPITEMIDLIST pidl
,DWORD dwFlags
,LPSTR lpstrFileName
);
59 extern HRESULT
GetFileName(HWND hwnd
, LPITEMIDLIST pidl
, LPSTR lpstrFileName
);
60 extern IShellFolder
* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs
);
61 extern LPITEMIDLIST
GetParentPidl(LPITEMIDLIST pidl
);
62 extern LPITEMIDLIST
GetPidlFromName(IShellFolder
*psf
,LPCSTR lpcstrFileName
);
64 extern BOOL
FILEDLG95_SHELL_FillIncludedItemList(HWND hwnd
,
65 LPITEMIDLIST pidlCurrentFolder
,
68 extern int FILEDLG95_LOOKIN_SelectItem(HWND hwnd
,LPITEMIDLIST pidl
);
69 extern BOOL
FILEDLG95_OnOpen(HWND hwnd
);
70 extern HRESULT
SendCustomDlgNotificationMessage(HWND hwndParentDlg
, UINT uCode
);
77 /* copied from shell32 to avoid linking to it */
78 static HRESULT
COMDLG32_StrRetToStrNW (LPVOID dest
, DWORD len
, LPSTRRET src
, LPITEMIDLIST pidl
)
80 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest
,len
,src
,pidl
);
85 lstrcpynW((LPWSTR
)dest
, src
->u
.pOleStr
, len
);
86 COMDLG32_SHFree(src
->u
.pOleStr
);
90 lstrcpynAtoW((LPWSTR
)dest
, src
->u
.cStr
, len
);
96 lstrcpynAtoW((LPWSTR
)dest
, ((LPCSTR
)&pidl
->mkid
)+src
->u
.uOffset
, len
);
101 FIXME("unknown type!\n");
103 { *(LPSTR
)dest
= '\0';
114 /**************************************************************************
115 * IShellBrowserImpl_Construct
117 IShellBrowser
* IShellBrowserImpl_Construct(HWND hwndOwner
)
119 IShellBrowserImpl
*sb
;
120 FileOpenDlgInfos
*fodInfos
= (FileOpenDlgInfos
*) GetPropA(hwndOwner
,FileOpenDlgInfosStr
);
122 sb
=(IShellBrowserImpl
*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl
));
124 /* Initialisation of the member variables */
126 sb
->hwndOwner
= hwndOwner
;
128 /* Initialisation of the vTables */
129 sb
->lpVtbl
= &IShellBrowserImpl_Vtbl
;
130 sb
->lpVtblCommDlgBrowser
= &IShellBrowserImpl_ICommDlgBrowser_Vtbl
;
131 sb
->lpVtblServiceProvider
= &IShellBrowserImpl_IServiceProvider_Vtbl
;
132 COMDLG32_SHGetSpecialFolderLocation(hwndOwner
, CSIDL_DESKTOP
,
133 &fodInfos
->ShellInfos
.pidlAbsCurrent
);
137 return (IShellBrowser
*) sb
;
140 /***************************************************************************
141 * IShellBrowserImpl_QueryInterface
143 HRESULT WINAPI
IShellBrowserImpl_QueryInterface(IShellBrowser
*iface
,
147 ICOM_THIS(IShellBrowserImpl
, iface
);
149 TRACE("(%p)\n\t%s\n", This
, debugstr_guid(riid
));
153 if(IsEqualIID(riid
, &IID_IUnknown
)) /*IUnknown*/
156 else if(IsEqualIID(riid
, &IID_IOleWindow
)) /*IOleWindow*/
157 { *ppvObj
= (IOleWindow
*)This
;
160 else if(IsEqualIID(riid
, &IID_IShellBrowser
)) /*IShellBrowser*/
161 { *ppvObj
= (IShellBrowser
*)This
;
164 else if(IsEqualIID(riid
, &IID_ICommDlgBrowser
)) /*ICommDlgBrowser*/
165 { *ppvObj
= (ICommDlgBrowser
*) &(This
->lpVtblCommDlgBrowser
);
168 else if(IsEqualIID(riid
, &IID_IServiceProvider
)) /* IServiceProvider */
169 { *ppvObj
= (ICommDlgBrowser
*) &(This
->lpVtblServiceProvider
);
173 { IUnknown_AddRef( (IShellBrowser
*) *ppvObj
);
176 FIXME("Unknown interface requested\n");
177 return E_NOINTERFACE
;
180 /**************************************************************************
181 * IShellBrowser::AddRef
183 ULONG WINAPI
IShellBrowserImpl_AddRef(IShellBrowser
* iface
)
185 ICOM_THIS(IShellBrowserImpl
, iface
);
187 TRACE("(%p)\n", This
);
189 return ++(This
->ref
);
192 /**************************************************************************
193 * IShellBrowserImpl_Release
195 ULONG WINAPI
IShellBrowserImpl_Release(IShellBrowser
* iface
)
197 ICOM_THIS(IShellBrowserImpl
, iface
);
199 TRACE("(%p)\n", This
);
203 HeapFree(GetProcessHeap(),0, This
);
213 /**************************************************************************
214 * IShellBrowserImpl_GetWindow (IOleWindow)
216 * Inherited from IOleWindow::GetWindow
218 * See Windows documentation for more details
220 * Note : We will never be window less in the File Open dialog
223 HRESULT WINAPI
IShellBrowserImpl_GetWindow(IShellBrowser
* iface
,
226 ICOM_THIS(IShellBrowserImpl
, iface
);
228 TRACE("(%p)\n", This
);
233 *phwnd
= This
->hwndOwner
;
235 return (*phwnd
) ? S_OK
: E_UNEXPECTED
;
239 /**************************************************************************
240 * IShellBrowserImpl_ContextSensitiveHelp
242 HRESULT WINAPI
IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser
* iface
,
245 ICOM_THIS(IShellBrowserImpl
, iface
);
247 TRACE("(%p)\n", This
);
249 /* Feature not implemented */
257 /**************************************************************************
258 * IShellBrowserImpl_BrowseObject
260 * See Windows documentation on IShellBrowser::BrowseObject for more details
262 * This function will override user specified flags and will always
263 * use SBSP_DEFBROWSER and SBSP_DEFMODE.
265 HRESULT WINAPI
IShellBrowserImpl_BrowseObject(IShellBrowser
*iface
,
270 IShellFolder
*psfTmp
;
272 FileOpenDlgInfos
*fodInfos
;
273 LPITEMIDLIST pidlTmp
;
278 ICOM_THIS(IShellBrowserImpl
, iface
);
280 TRACE("(%p)(%p,0x%08x)\n", This
, pidl
, wFlags
);
282 fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
284 /* Format the pidl according to its parameter's category */
285 if(wFlags
& SBSP_RELATIVE
)
288 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */
289 if(FAILED(hRes
= IShellFolder_BindToObject(fodInfos
->Shell
.FOIShellFolder
,
290 pidl
, NULL
, &IID_IShellFolder
, (LPVOID
*)&psfTmp
)))
292 ERR("bind to object failed\n");
295 /* create an absolute pidl */
296 pidlTmp
= COMDLG32_PIDL_ILCombine(fodInfos
->ShellInfos
.pidlAbsCurrent
,
299 else if(wFlags
& SBSP_PARENT
)
301 /* Browse the parent folder (ignores the pidl) */
302 pidlTmp
= GetParentPidl(fodInfos
->ShellInfos
.pidlAbsCurrent
);
303 psfTmp
= GetShellFolderFromPidl(pidlTmp
);
306 else /* SBSP_ABSOLUTE is 0x0000 */
308 /* An absolute pidl (relative from the desktop) */
309 pidlTmp
= COMDLG32_PIDL_ILClone((LPITEMIDLIST
)pidl
);
310 psfTmp
= GetShellFolderFromPidl(pidlTmp
);
315 ERR("could not browse to folder\n");
319 /* If the pidl to browse to is equal to the actual pidl ...
320 do nothing and pretend you did it*/
321 if(COMDLG32_PIDL_ILIsEqual(pidlTmp
,fodInfos
->ShellInfos
.pidlAbsCurrent
))
323 IShellFolder_Release(psfTmp
);
324 COMDLG32_SHFree(pidlTmp
);
325 TRACE("keep current folder\n");
329 /* Release the current DataObject */
330 if (fodInfos
->Shell
.FOIDataObject
)
332 IDataObject_Release(fodInfos
->Shell
.FOIDataObject
);
333 fodInfos
->Shell
.FOIDataObject
= NULL
;
336 /* Create the associated view */
337 TRACE("create view object\n");
338 if(FAILED(hRes
= IShellFolder_CreateViewObject(psfTmp
, fodInfos
->ShellInfos
.hwndOwner
,
339 &IID_IShellView
, (LPVOID
*)&psvTmp
))) goto error
;
341 /* Check if listview has focus */
342 bViewHasFocus
= IsChild(fodInfos
->ShellInfos
.hwndView
,GetFocus());
344 /* Get the foldersettings from the old view */
345 if(fodInfos
->Shell
.FOIShellView
)
346 IShellView_GetCurrentInfo(fodInfos
->Shell
.FOIShellView
, &fodInfos
->ShellInfos
.folderSettings
);
348 /* Release the old fodInfos->Shell.FOIShellView and update its value.
349 We have to update this early since ShellView_CreateViewWindow of native
350 shell32 calls OnStateChange and needs the correct view here.*/
351 if(fodInfos
->Shell
.FOIShellView
)
353 IShellView_DestroyViewWindow(fodInfos
->Shell
.FOIShellView
);
354 IShellView_Release(fodInfos
->Shell
.FOIShellView
);
356 fodInfos
->Shell
.FOIShellView
= psvTmp
;
358 /* Release old FOIShellFolder and update its value */
359 if (fodInfos
->Shell
.FOIShellFolder
)
360 IShellFolder_Release(fodInfos
->Shell
.FOIShellFolder
);
361 fodInfos
->Shell
.FOIShellFolder
= psfTmp
;
363 /* Release old pidlAbsCurrent and update its value */
364 COMDLG32_SHFree((LPVOID
)fodInfos
->ShellInfos
.pidlAbsCurrent
);
365 fodInfos
->ShellInfos
.pidlAbsCurrent
= pidlTmp
;
367 /* Create the window */
368 TRACE("create view window\n");
369 if(FAILED(hRes
= IShellView_CreateViewWindow(psvTmp
, NULL
,
370 &fodInfos
->ShellInfos
.folderSettings
, fodInfos
->Shell
.FOIShellBrowser
,
371 &fodInfos
->ShellInfos
.rectView
, &hwndView
))) goto error
;
373 fodInfos
->ShellInfos
.hwndView
= hwndView
;
375 /* Select the new folder in the Look In combo box of the Open file dialog */
376 FILEDLG95_LOOKIN_SelectItem(fodInfos
->DlgInfos
.hwndLookInCB
,fodInfos
->ShellInfos
.pidlAbsCurrent
);
378 /* changes the tab order of the ListView to reflect the window's File Dialog */
379 hDlgWnd
= GetDlgItem(GetParent(hwndView
), IDC_LOOKIN
);
380 SetWindowPos(hwndView
, hDlgWnd
, 0,0,0,0, SWP_NOMOVE
| SWP_NOSIZE
);
382 /* Since we destroyed the old view if it had focus set focus to the newly created view */
384 SetFocus(fodInfos
->ShellInfos
.hwndView
);
388 ERR("Failed with error 0x%08lx\n", hRes
);
392 /**************************************************************************
393 * IShellBrowserImpl_EnableModelessSB
395 HRESULT WINAPI
IShellBrowserImpl_EnableModelessSB(IShellBrowser
*iface
,
399 ICOM_THIS(IShellBrowserImpl
, iface
);
401 TRACE("(%p)\n", This
);
403 /* Feature not implemented */
407 /**************************************************************************
408 * IShellBrowserImpl_GetControlWindow
410 HRESULT WINAPI
IShellBrowserImpl_GetControlWindow(IShellBrowser
*iface
,
415 ICOM_THIS(IShellBrowserImpl
, iface
);
417 TRACE("(%p)\n", This
);
419 /* Feature not implemented */
422 /**************************************************************************
423 * IShellBrowserImpl_GetViewStateStream
425 HRESULT WINAPI
IShellBrowserImpl_GetViewStateStream(IShellBrowser
*iface
,
430 ICOM_THIS(IShellBrowserImpl
, iface
);
432 FIXME("(%p 0x%08lx %p)\n", This
, grfMode
, ppStrm
);
434 /* Feature not implemented */
437 /**************************************************************************
438 * IShellBrowserImpl_InsertMenusSB
440 HRESULT WINAPI
IShellBrowserImpl_InsertMenusSB(IShellBrowser
*iface
,
442 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
445 ICOM_THIS(IShellBrowserImpl
, iface
);
447 TRACE("(%p)\n", This
);
449 /* Feature not implemented */
452 /**************************************************************************
453 * IShellBrowserImpl_OnViewWindowActive
455 HRESULT WINAPI
IShellBrowserImpl_OnViewWindowActive(IShellBrowser
*iface
,
459 ICOM_THIS(IShellBrowserImpl
, iface
);
461 TRACE("(%p)\n", This
);
463 /* Feature not implemented */
466 /**************************************************************************
467 * IShellBrowserImpl_QueryActiveShellView
469 HRESULT WINAPI
IShellBrowserImpl_QueryActiveShellView(IShellBrowser
*iface
,
473 ICOM_THIS(IShellBrowserImpl
, iface
);
475 FileOpenDlgInfos
*fodInfos
;
477 TRACE("(%p)\n", This
);
479 fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
481 if(!(*ppshv
= fodInfos
->Shell
.FOIShellView
))
485 IShellView_AddRef(fodInfos
->Shell
.FOIShellView
);
488 /**************************************************************************
489 * IShellBrowserImpl_RemoveMenusSB
491 HRESULT WINAPI
IShellBrowserImpl_RemoveMenusSB(IShellBrowser
*iface
,
495 ICOM_THIS(IShellBrowserImpl
, iface
);
497 TRACE("(%p)\n", This
);
499 /* Feature not implemented */
502 /**************************************************************************
503 * IShellBrowserImpl_SendControlMsg
505 HRESULT WINAPI
IShellBrowserImpl_SendControlMsg(IShellBrowser
*iface
,
513 ICOM_THIS(IShellBrowserImpl
, iface
);
516 TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This
, id
, uMsg
, wParam
, lParam
, pret
);
521 lres
= SendDlgItemMessageA( This
->hwndOwner
, IDC_TOOLBAR
, uMsg
, wParam
, lParam
);
524 FIXME("ctrl id: %x\n", id
);
527 if (pret
) *pret
= lres
;
530 /**************************************************************************
531 * IShellBrowserImpl_SetMenuSB
533 HRESULT WINAPI
IShellBrowserImpl_SetMenuSB(IShellBrowser
*iface
,
535 HOLEMENU holemenuReserved
,
536 HWND hwndActiveObject
)
539 ICOM_THIS(IShellBrowserImpl
, iface
);
541 TRACE("(%p)\n", This
);
543 /* Feature not implemented */
546 /**************************************************************************
547 * IShellBrowserImpl_SetStatusTextSB
549 HRESULT WINAPI
IShellBrowserImpl_SetStatusTextSB(IShellBrowser
*iface
,
550 LPCOLESTR lpszStatusText
)
553 ICOM_THIS(IShellBrowserImpl
, iface
);
555 TRACE("(%p)\n", This
);
557 /* Feature not implemented */
560 /**************************************************************************
561 * IShellBrowserImpl_SetToolbarItems
563 HRESULT WINAPI
IShellBrowserImpl_SetToolbarItems(IShellBrowser
*iface
,
564 LPTBBUTTON lpButtons
,
569 ICOM_THIS(IShellBrowserImpl
, iface
);
571 TRACE("(%p)\n", This
);
573 /* Feature not implemented */
576 /**************************************************************************
577 * IShellBrowserImpl_TranslateAcceleratorSB
579 HRESULT WINAPI
IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser
*iface
,
584 ICOM_THIS(IShellBrowserImpl
, iface
);
586 TRACE("(%p)\n", This
);
588 /* Feature not implemented */
592 static ICOM_VTABLE(IShellBrowser
) IShellBrowserImpl_Vtbl
=
594 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
596 IShellBrowserImpl_QueryInterface
,
597 IShellBrowserImpl_AddRef
,
598 IShellBrowserImpl_Release
,
600 IShellBrowserImpl_GetWindow
,
601 IShellBrowserImpl_ContextSensitiveHelp
,
603 IShellBrowserImpl_InsertMenusSB
,
604 IShellBrowserImpl_SetMenuSB
,
605 IShellBrowserImpl_RemoveMenusSB
,
606 IShellBrowserImpl_SetStatusTextSB
,
607 IShellBrowserImpl_EnableModelessSB
,
608 IShellBrowserImpl_TranslateAcceleratorSB
,
609 IShellBrowserImpl_BrowseObject
,
610 IShellBrowserImpl_GetViewStateStream
,
611 IShellBrowserImpl_GetControlWindow
,
612 IShellBrowserImpl_SendControlMsg
,
613 IShellBrowserImpl_QueryActiveShellView
,
614 IShellBrowserImpl_OnViewWindowActive
,
615 IShellBrowserImpl_SetToolbarItems
624 /***************************************************************************
625 * IShellBrowserImpl_ICommDlgBrowser_QueryInterface
627 HRESULT WINAPI
IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
628 ICommDlgBrowser
*iface
,
632 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser
,iface
);
634 TRACE("(%p)\n", This
);
636 return IShellBrowserImpl_QueryInterface(This
,riid
,ppvObj
);
639 /**************************************************************************
640 * IShellBrowserImpl_ICommDlgBrowser_AddRef
642 ULONG WINAPI
IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser
* iface
)
644 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser
,iface
);
646 TRACE("(%p)\n", This
);
648 return IShellBrowserImpl_AddRef(This
);
651 /**************************************************************************
652 * IShellBrowserImpl_ICommDlgBrowser_Release
654 ULONG WINAPI
IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser
* iface
)
656 _ICOM_THIS_FromICommDlgBrowser(IShellBrowser
,iface
);
658 TRACE("(%p)\n", This
);
660 return IShellBrowserImpl_Release(This
);
662 /**************************************************************************
663 * IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
665 * Called when a user double-clicks in the view or presses the ENTER key
667 HRESULT WINAPI
IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser
*iface
,
671 FileOpenDlgInfos
*fodInfos
;
673 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl
,iface
);
675 TRACE("(%p)\n", This
);
677 fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
679 /* If the selected object is not a folder, send a IDOK command to parent window */
680 if((pidl
= GetPidlFromDataObject(fodInfos
->Shell
.FOIDataObject
, 1)))
684 ULONG ulAttr
= SFGAO_FOLDER
| SFGAO_HASSUBFOLDER
;
685 IShellFolder_GetAttributesOf(fodInfos
->Shell
.FOIShellFolder
, 1, &pidl
, &ulAttr
);
686 if (ulAttr
& (SFGAO_FOLDER
| SFGAO_HASSUBFOLDER
) )
688 hRes
= IShellBrowser_BrowseObject((IShellBrowser
*)This
,pidl
,SBSP_RELATIVE
);
692 /* Tell the dialog that the user selected a file */
693 hRes
= PostMessageA(This
->hwndOwner
, WM_COMMAND
, IDOK
, 0L);
696 /* Free memory used by pidl */
697 COMDLG32_SHFree((LPVOID
)pidl
);
705 /**************************************************************************
706 * IShellBrowserImpl_ICommDlgBrowser_OnStateChange
708 HRESULT WINAPI
IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser
*iface
,
713 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl
,iface
);
715 TRACE("(%p shv=%p)\n", This
, ppshv
);
719 case CDBOSC_SETFOCUS
:
720 /* FIXME: Reset the default button.
721 This should be taken care of by defdlg. If control
722 other than button receives focus the default button
723 should be restored. */
724 SendMessageA(This
->hwndOwner
, DM_SETDEFID
, IDOK
, 0);
727 case CDBOSC_KILLFOCUS
:
729 FileOpenDlgInfos
*fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
730 if(fodInfos
->DlgInfos
.dwDlgProp
& FODPROP_SAVEDLG
)
731 SetDlgItemTextA(fodInfos
->ShellInfos
.hwndOwner
,IDOK
,"&Save");
734 case CDBOSC_SELCHANGE
:
735 return IShellBrowserImpl_ICommDlgBrowser_OnSelChange(iface
,ppshv
);
744 /**************************************************************************
745 * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
747 HRESULT WINAPI
IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser
*iface
,
751 FileOpenDlgInfos
*fodInfos
;
754 WCHAR szPathW
[MAX_PATH
];
756 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl
,iface
);
758 TRACE("(%p)\n", This
);
760 fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
762 ulAttr
= SFGAO_HIDDEN
| SFGAO_FOLDER
| SFGAO_FILESYSTEM
| SFGAO_FILESYSANCESTOR
| SFGAO_LINK
;
763 IShellFolder_GetAttributesOf(fodInfos
->Shell
.FOIShellFolder
, 1, &pidl
, &ulAttr
);
765 if( (ulAttr
& SFGAO_HIDDEN
) /* hidden */
766 | !(ulAttr
& (SFGAO_FILESYSTEM
| SFGAO_FILESYSANCESTOR
))) /* special folder */
769 /* always include directorys and links */
770 if(ulAttr
& (SFGAO_FOLDER
| SFGAO_LINK
))
773 /* Check if there is a mask to apply if not */
774 if(!fodInfos
->ShellInfos
.lpstrCurrentFilter
|| !lstrlenW(fodInfos
->ShellInfos
.lpstrCurrentFilter
))
777 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos
->Shell
.FOIShellFolder
, pidl
, SHGDN_INFOLDER
| SHGDN_FORPARSING
, &str
)))
779 if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW
, MAX_PATH
, &str
, pidl
)))
781 if (COMDLG32_PathMatchSpecW(szPathW
, fodInfos
->ShellInfos
.lpstrCurrentFilter
))
789 /**************************************************************************
790 * IShellBrowserImpl_ICommDlgBrowser_OnSelChange
792 HRESULT
IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser
*iface
, IShellView
*ppshv
)
794 FileOpenDlgInfos
*fodInfos
;
796 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl
,iface
);
798 fodInfos
= (FileOpenDlgInfos
*) GetPropA(This
->hwndOwner
,FileOpenDlgInfosStr
);
799 TRACE("(%p do=%p view=%p)\n", This
, fodInfos
->Shell
.FOIDataObject
, fodInfos
->Shell
.FOIShellView
);
801 /* release old selections */
802 if (fodInfos
->Shell
.FOIDataObject
)
803 IDataObject_Release(fodInfos
->Shell
.FOIDataObject
);
805 /* get a new DataObject from the ShellView */
806 if(FAILED(IShellView_GetItemObject(fodInfos
->Shell
.FOIShellView
, SVGIO_SELECTION
,
807 &IID_IDataObject
, (LPVOID
*)&fodInfos
->Shell
.FOIDataObject
)))
810 FILEDLG95_FILENAME_FillFromSelection(This
->hwndOwner
);
812 SendCustomDlgNotificationMessage(This
->hwndOwner
, CDN_SELCHANGE
);
816 static ICOM_VTABLE(ICommDlgBrowser
) IShellBrowserImpl_ICommDlgBrowser_Vtbl
=
818 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
820 IShellBrowserImpl_ICommDlgBrowser_QueryInterface
,
821 IShellBrowserImpl_ICommDlgBrowser_AddRef
,
822 IShellBrowserImpl_ICommDlgBrowser_Release
,
823 /* ICommDlgBrowser */
824 IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
,
825 IShellBrowserImpl_ICommDlgBrowser_OnStateChange
,
826 IShellBrowserImpl_ICommDlgBrowser_IncludeObject
836 /***************************************************************************
837 * IShellBrowserImpl_IServiceProvider_QueryInterface
839 HRESULT WINAPI
IShellBrowserImpl_IServiceProvider_QueryInterface(
840 IServiceProvider
*iface
,
844 _ICOM_THIS_FromIServiceProvider(IShellBrowser
,iface
);
846 FIXME("(%p)\n", This
);
848 return IShellBrowserImpl_QueryInterface(This
,riid
,ppvObj
);
851 /**************************************************************************
852 * IShellBrowserImpl_IServiceProvider_AddRef
854 ULONG WINAPI
IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider
* iface
)
856 _ICOM_THIS_FromIServiceProvider(IShellBrowser
,iface
);
858 FIXME("(%p)\n", This
);
860 return IShellBrowserImpl_AddRef(This
);
863 /**************************************************************************
864 * IShellBrowserImpl_IServiceProvider_Release
866 ULONG WINAPI
IShellBrowserImpl_IServiceProvider_Release(IServiceProvider
* iface
)
868 _ICOM_THIS_FromIServiceProvider(IShellBrowser
,iface
);
870 FIXME("(%p)\n", This
);
872 return IShellBrowserImpl_Release(This
);
875 /**************************************************************************
876 * IShellBrowserImpl_IServiceProvider_Release
879 * the w2k shellview asks for
880 * guidService = SID_STopLevelBrowser
881 * riid = IShellBrowser
887 HRESULT WINAPI
IShellBrowserImpl_IServiceProvider_QueryService(
888 IServiceProvider
* iface
,
893 _ICOM_THIS_FromIServiceProvider(IShellBrowser
,iface
);
895 FIXME("(%p)\n\t%s\n\t%s\n", This
,debugstr_guid(guidService
), debugstr_guid(riid
) );
898 if(guidService
&& IsEqualIID(guidService
, &SID_STopLevelBrowser
))
900 return IShellBrowserImpl_QueryInterface(This
,riid
,ppv
);
902 FIXME("(%p) unknown interface requested\n", This
);
903 return E_NOINTERFACE
;
907 static ICOM_VTABLE(IServiceProvider
) IShellBrowserImpl_IServiceProvider_Vtbl
=
909 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
911 IShellBrowserImpl_IServiceProvider_QueryInterface
,
912 IShellBrowserImpl_IServiceProvider_AddRef
,
913 IShellBrowserImpl_IServiceProvider_Release
,
914 /* IServiceProvider */
915 IShellBrowserImpl_IServiceProvider_QueryService