| 1 | /*
|
|---|
| 2 | * Implementation of IShellBrowser for the File Open common dialog
|
|---|
| 3 | *
|
|---|
| 4 | *
|
|---|
| 5 | */
|
|---|
| 6 |
|
|---|
| 7 | #include <stdio.h>
|
|---|
| 8 | #include <string.h>
|
|---|
| 9 |
|
|---|
| 10 | #include "windef.h"
|
|---|
| 11 | #include "winbase.h"
|
|---|
| 12 | #include "winnls.h"
|
|---|
| 13 | #include "wingdi.h"
|
|---|
| 14 | #include "winuser.h"
|
|---|
| 15 | #include "heap.h"
|
|---|
| 16 | #include "debugtools.h"
|
|---|
| 17 |
|
|---|
| 18 | #include "shlwapi.h"
|
|---|
| 19 | #include "filedlgbrowser.h"
|
|---|
| 20 | #include "cdlg.h"
|
|---|
| 21 | #include "shlguid.h"
|
|---|
| 22 | #include "wine/obj_serviceprovider.h"
|
|---|
| 23 |
|
|---|
| 24 | #ifdef __WIN32OS2__
|
|---|
| 25 | #include <heapstring.h>
|
|---|
| 26 | #include <misc.h>
|
|---|
| 27 | #endif
|
|---|
| 28 |
|
|---|
| 29 | DEFAULT_DEBUG_CHANNEL(commdlg);
|
|---|
| 30 |
|
|---|
| 31 | typedef struct
|
|---|
| 32 | {
|
|---|
| 33 |
|
|---|
| 34 | ICOM_VTABLE(IShellBrowser) * lpVtbl;
|
|---|
| 35 | ICOM_VTABLE(ICommDlgBrowser) * lpVtblCommDlgBrowser;
|
|---|
| 36 | ICOM_VTABLE(IServiceProvider)* lpVtblServiceProvider;
|
|---|
| 37 | DWORD ref; /* Reference counter */
|
|---|
| 38 | HWND hwndOwner; /* Owner dialog of the interface */
|
|---|
| 39 |
|
|---|
| 40 | } IShellBrowserImpl;
|
|---|
| 41 |
|
|---|
| 42 | /**************************************************************************
|
|---|
| 43 | * vtable
|
|---|
| 44 | */
|
|---|
| 45 | static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl;
|
|---|
| 46 | static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl;
|
|---|
| 47 | static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl;
|
|---|
| 48 |
|
|---|
| 49 | /**************************************************************************
|
|---|
| 50 | * Local Prototypes
|
|---|
| 51 | */
|
|---|
| 52 |
|
|---|
| 53 | HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv);
|
|---|
| 54 | #if 0
|
|---|
| 55 | LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
|
|---|
| 56 | #endif
|
|---|
| 57 |
|
|---|
| 58 | /**************************************************************************
|
|---|
| 59 | * External Prototypes
|
|---|
| 60 | */
|
|---|
| 61 | extern const char *FileOpenDlgInfosStr;
|
|---|
| 62 |
|
|---|
| 63 | extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName);
|
|---|
| 64 | extern HRESULT GetFileName(HWND hwnd, LPITEMIDLIST pidl, LPSTR lpstrFileName);
|
|---|
| 65 | extern IShellFolder* GetShellFolderFromPidl(LPITEMIDLIST pidlAbs);
|
|---|
| 66 | extern LPITEMIDLIST GetParentPidl(LPITEMIDLIST pidl);
|
|---|
| 67 | extern LPITEMIDLIST GetPidlFromName(IShellFolder *psf,LPCSTR lpcstrFileName);
|
|---|
| 68 |
|
|---|
| 69 | extern BOOL FILEDLG95_SHELL_FillIncludedItemList(HWND hwnd,
|
|---|
| 70 | LPITEMIDLIST pidlCurrentFolder,
|
|---|
| 71 | LPSTR lpstrMask);
|
|---|
| 72 |
|
|---|
| 73 | extern int FILEDLG95_LOOKIN_SelectItem(HWND hwnd,LPITEMIDLIST pidl);
|
|---|
| 74 | extern BOOL FILEDLG95_OnOpen(HWND hwnd);
|
|---|
| 75 | extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 | /*
|
|---|
| 79 | * Helper functions
|
|---|
| 80 | */
|
|---|
| 81 |
|
|---|
| 82 | static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
|
|---|
| 83 | {
|
|---|
| 84 | char lpstrPath[MAX_PATH];
|
|---|
| 85 | SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
|
|---|
| 86 | SetCurrentDirectoryA(lpstrPath);
|
|---|
| 87 | TRACE("new current folder %s\n", lpstrPath);
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | /* copied from shell32 to avoid linking to it */
|
|---|
| 91 | static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
|
|---|
| 92 | {
|
|---|
| 93 | TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
|
|---|
| 94 |
|
|---|
| 95 | switch (src->uType)
|
|---|
| 96 | {
|
|---|
| 97 | case STRRET_WSTR:
|
|---|
| 98 | lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
|
|---|
| 99 | COMDLG32_SHFree(src->u.pOleStr);
|
|---|
| 100 | break;
|
|---|
| 101 |
|
|---|
| 102 | case STRRET_CSTRA:
|
|---|
| 103 | if (len && !MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, (LPWSTR)dest, len ))
|
|---|
| 104 | ((LPWSTR)dest)[len-1] = 0;
|
|---|
| 105 | break;
|
|---|
| 106 |
|
|---|
| 107 | case STRRET_OFFSETA:
|
|---|
| 108 | if (pidl)
|
|---|
| 109 | {
|
|---|
| 110 | if (len && !MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset,
|
|---|
| 111 | -1, (LPWSTR)dest, len ))
|
|---|
| 112 | ((LPWSTR)dest)[len-1] = 0;
|
|---|
| 113 | }
|
|---|
| 114 | break;
|
|---|
| 115 |
|
|---|
| 116 | default:
|
|---|
| 117 | FIXME("unknown type!\n");
|
|---|
| 118 | if (len)
|
|---|
| 119 | { *(LPWSTR)dest = '\0';
|
|---|
| 120 | }
|
|---|
| 121 | return(FALSE);
|
|---|
| 122 | }
|
|---|
| 123 | return S_OK;
|
|---|
| 124 | }
|
|---|
| 125 |
|
|---|
| 126 | /*
|
|---|
| 127 | * IShellBrowser
|
|---|
| 128 | */
|
|---|
| 129 |
|
|---|
| 130 | /**************************************************************************
|
|---|
| 131 | * IShellBrowserImpl_Construct
|
|---|
| 132 | */
|
|---|
| 133 | IShellBrowser * IShellBrowserImpl_Construct(HWND hwndOwner)
|
|---|
| 134 | {
|
|---|
| 135 | IShellBrowserImpl *sb;
|
|---|
| 136 | FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 137 |
|
|---|
| 138 | sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl));
|
|---|
| 139 |
|
|---|
| 140 | /* Initialisation of the member variables */
|
|---|
| 141 | sb->ref=1;
|
|---|
| 142 | sb->hwndOwner = hwndOwner;
|
|---|
| 143 |
|
|---|
| 144 | /* Initialisation of the vTables */
|
|---|
| 145 | sb->lpVtbl = &IShellBrowserImpl_Vtbl;
|
|---|
| 146 | sb->lpVtblCommDlgBrowser = &IShellBrowserImpl_ICommDlgBrowser_Vtbl;
|
|---|
| 147 | sb->lpVtblServiceProvider = &IShellBrowserImpl_IServiceProvider_Vtbl;
|
|---|
| 148 | SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP,
|
|---|
| 149 | &fodInfos->ShellInfos.pidlAbsCurrent);
|
|---|
| 150 |
|
|---|
| 151 | TRACE("%p\n", sb);
|
|---|
| 152 |
|
|---|
| 153 | return (IShellBrowser *) sb;
|
|---|
| 154 | }
|
|---|
| 155 |
|
|---|
| 156 | /***************************************************************************
|
|---|
| 157 | * IShellBrowserImpl_QueryInterface
|
|---|
| 158 | */
|
|---|
| 159 | HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface,
|
|---|
| 160 | REFIID riid,
|
|---|
| 161 | LPVOID *ppvObj)
|
|---|
| 162 | {
|
|---|
| 163 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 164 |
|
|---|
| 165 | TRACE("(%p)\n\t%s\n", This, debugstr_guid(riid));
|
|---|
| 166 |
|
|---|
| 167 | *ppvObj = NULL;
|
|---|
| 168 |
|
|---|
| 169 | if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/
|
|---|
| 170 | { *ppvObj = This;
|
|---|
| 171 | }
|
|---|
| 172 | else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/
|
|---|
| 173 | { *ppvObj = (IOleWindow*)This;
|
|---|
| 174 | }
|
|---|
| 175 |
|
|---|
| 176 | else if(IsEqualIID(riid, &IID_IShellBrowser)) /*IShellBrowser*/
|
|---|
| 177 | { *ppvObj = (IShellBrowser*)This;
|
|---|
| 178 | }
|
|---|
| 179 |
|
|---|
| 180 | else if(IsEqualIID(riid, &IID_ICommDlgBrowser)) /*ICommDlgBrowser*/
|
|---|
| 181 | { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblCommDlgBrowser);
|
|---|
| 182 | }
|
|---|
| 183 |
|
|---|
| 184 | else if(IsEqualIID(riid, &IID_IServiceProvider)) /* IServiceProvider */
|
|---|
| 185 | { *ppvObj = (ICommDlgBrowser*) &(This->lpVtblServiceProvider);
|
|---|
| 186 | }
|
|---|
| 187 |
|
|---|
| 188 | if(*ppvObj)
|
|---|
| 189 | { IUnknown_AddRef( (IShellBrowser*) *ppvObj);
|
|---|
| 190 | return S_OK;
|
|---|
| 191 | }
|
|---|
| 192 | FIXME("Unknown interface requested\n");
|
|---|
| 193 | return E_NOINTERFACE;
|
|---|
| 194 | }
|
|---|
| 195 |
|
|---|
| 196 | /**************************************************************************
|
|---|
| 197 | * IShellBrowser::AddRef
|
|---|
| 198 | */
|
|---|
| 199 | ULONG WINAPI IShellBrowserImpl_AddRef(IShellBrowser * iface)
|
|---|
| 200 | {
|
|---|
| 201 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 202 |
|
|---|
| 203 | TRACE("(%p)\n", This);
|
|---|
| 204 |
|
|---|
| 205 | return ++(This->ref);
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 | /**************************************************************************
|
|---|
| 209 | * IShellBrowserImpl_Release
|
|---|
| 210 | */
|
|---|
| 211 | ULONG WINAPI IShellBrowserImpl_Release(IShellBrowser * iface)
|
|---|
| 212 | {
|
|---|
| 213 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 214 |
|
|---|
| 215 | TRACE("(%p)\n", This);
|
|---|
| 216 |
|
|---|
| 217 | if (!--(This->ref))
|
|---|
| 218 | {
|
|---|
| 219 | HeapFree(GetProcessHeap(),0, This);
|
|---|
| 220 | return 0;
|
|---|
| 221 | }
|
|---|
| 222 | return This->ref;
|
|---|
| 223 | }
|
|---|
| 224 |
|
|---|
| 225 | /*
|
|---|
| 226 | * IOleWindow
|
|---|
| 227 | */
|
|---|
| 228 |
|
|---|
| 229 | /**************************************************************************
|
|---|
| 230 | * IShellBrowserImpl_GetWindow (IOleWindow)
|
|---|
| 231 | *
|
|---|
| 232 | * Inherited from IOleWindow::GetWindow
|
|---|
| 233 | *
|
|---|
| 234 | * See Windows documentation for more details
|
|---|
| 235 | *
|
|---|
| 236 | * Note : We will never be window less in the File Open dialog
|
|---|
| 237 | *
|
|---|
| 238 | */
|
|---|
| 239 | HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface,
|
|---|
| 240 | HWND * phwnd)
|
|---|
| 241 | {
|
|---|
| 242 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 243 |
|
|---|
| 244 | TRACE("(%p)\n", This);
|
|---|
| 245 |
|
|---|
| 246 | if(!This->hwndOwner)
|
|---|
| 247 | return E_FAIL;
|
|---|
| 248 |
|
|---|
| 249 | *phwnd = This->hwndOwner;
|
|---|
| 250 |
|
|---|
| 251 | return (*phwnd) ? S_OK : E_UNEXPECTED;
|
|---|
| 252 |
|
|---|
| 253 | }
|
|---|
| 254 |
|
|---|
| 255 | /**************************************************************************
|
|---|
| 256 | * IShellBrowserImpl_ContextSensitiveHelp
|
|---|
| 257 | */
|
|---|
| 258 | HRESULT WINAPI IShellBrowserImpl_ContextSensitiveHelp(IShellBrowser * iface,
|
|---|
| 259 | BOOL fEnterMode)
|
|---|
| 260 | {
|
|---|
| 261 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 262 |
|
|---|
| 263 | TRACE("(%p)\n", This);
|
|---|
| 264 |
|
|---|
| 265 | /* Feature not implemented */
|
|---|
| 266 | return E_NOTIMPL;
|
|---|
| 267 | }
|
|---|
| 268 |
|
|---|
| 269 | /*
|
|---|
| 270 | * IShellBrowser
|
|---|
| 271 | */
|
|---|
| 272 |
|
|---|
| 273 | /**************************************************************************
|
|---|
| 274 | * IShellBrowserImpl_BrowseObject
|
|---|
| 275 | *
|
|---|
| 276 | * See Windows documentation on IShellBrowser::BrowseObject for more details
|
|---|
| 277 | *
|
|---|
| 278 | * This function will override user specified flags and will always
|
|---|
| 279 | * use SBSP_DEFBROWSER and SBSP_DEFMODE.
|
|---|
| 280 | */
|
|---|
| 281 | HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface,
|
|---|
| 282 | LPCITEMIDLIST pidl,
|
|---|
| 283 | UINT wFlags)
|
|---|
| 284 | {
|
|---|
| 285 | HRESULT hRes;
|
|---|
| 286 | IShellFolder *psfTmp;
|
|---|
| 287 | IShellView *psvTmp;
|
|---|
| 288 | FileOpenDlgInfos *fodInfos;
|
|---|
| 289 | LPITEMIDLIST pidlTmp;
|
|---|
| 290 | HWND hwndView;
|
|---|
| 291 | HWND hDlgWnd;
|
|---|
| 292 | BOOL bViewHasFocus;
|
|---|
| 293 |
|
|---|
| 294 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 295 |
|
|---|
| 296 | TRACE("(%p)(%p,0x%08x)\n", This, pidl, wFlags);
|
|---|
| 297 |
|
|---|
| 298 | fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 299 |
|
|---|
| 300 | /* Format the pidl according to its parameter's category */
|
|---|
| 301 | if(wFlags & SBSP_RELATIVE)
|
|---|
| 302 | {
|
|---|
| 303 |
|
|---|
| 304 | /* SBSP_RELATIVE A relative pidl (relative from the current folder) */
|
|---|
| 305 | if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder,
|
|---|
| 306 | pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp)))
|
|---|
| 307 | {
|
|---|
| 308 | ERR("bind to object failed\n");
|
|---|
| 309 | return hRes;
|
|---|
| 310 | }
|
|---|
| 311 | /* create an absolute pidl */
|
|---|
| 312 | pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent,
|
|---|
| 313 | (LPITEMIDLIST)pidl);
|
|---|
| 314 | }
|
|---|
| 315 | else if(wFlags & SBSP_PARENT)
|
|---|
| 316 | {
|
|---|
| 317 | /* Browse the parent folder (ignores the pidl) */
|
|---|
| 318 | pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent);
|
|---|
| 319 | psfTmp = GetShellFolderFromPidl(pidlTmp);
|
|---|
| 320 |
|
|---|
| 321 | }
|
|---|
| 322 | else /* SBSP_ABSOLUTE is 0x0000 */
|
|---|
| 323 | {
|
|---|
| 324 | /* An absolute pidl (relative from the desktop) */
|
|---|
| 325 | pidlTmp = COMDLG32_PIDL_ILClone((LPITEMIDLIST)pidl);
|
|---|
| 326 | psfTmp = GetShellFolderFromPidl(pidlTmp);
|
|---|
| 327 | }
|
|---|
| 328 |
|
|---|
| 329 | if(!psfTmp)
|
|---|
| 330 | {
|
|---|
| 331 | ERR("could not browse to folder\n");
|
|---|
| 332 | return E_FAIL;
|
|---|
| 333 | }
|
|---|
| 334 |
|
|---|
| 335 | /* If the pidl to browse to is equal to the actual pidl ...
|
|---|
| 336 | do nothing and pretend you did it*/
|
|---|
| 337 | if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent))
|
|---|
| 338 | {
|
|---|
| 339 | IShellFolder_Release(psfTmp);
|
|---|
| 340 | COMDLG32_SHFree(pidlTmp);
|
|---|
| 341 | TRACE("keep current folder\n");
|
|---|
| 342 | return NOERROR;
|
|---|
| 343 | }
|
|---|
| 344 |
|
|---|
| 345 | /* Release the current DataObject */
|
|---|
| 346 | if (fodInfos->Shell.FOIDataObject)
|
|---|
| 347 | {
|
|---|
| 348 | IDataObject_Release(fodInfos->Shell.FOIDataObject);
|
|---|
| 349 | fodInfos->Shell.FOIDataObject = NULL;
|
|---|
| 350 | }
|
|---|
| 351 |
|
|---|
| 352 | /* Create the associated view */
|
|---|
| 353 | TRACE("create view object\n");
|
|---|
| 354 | if(FAILED(hRes = IShellFolder_CreateViewObject(psfTmp, fodInfos->ShellInfos.hwndOwner,
|
|---|
| 355 | &IID_IShellView, (LPVOID *)&psvTmp))) goto error;
|
|---|
| 356 |
|
|---|
| 357 | /* Check if listview has focus */
|
|---|
| 358 | bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus());
|
|---|
| 359 |
|
|---|
| 360 | /* Get the foldersettings from the old view */
|
|---|
| 361 | if(fodInfos->Shell.FOIShellView)
|
|---|
| 362 | IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings);
|
|---|
| 363 |
|
|---|
| 364 | /* Release the old fodInfos->Shell.FOIShellView and update its value.
|
|---|
| 365 | We have to update this early since ShellView_CreateViewWindow of native
|
|---|
| 366 | shell32 calls OnStateChange and needs the correct view here.*/
|
|---|
| 367 | if(fodInfos->Shell.FOIShellView)
|
|---|
| 368 | {
|
|---|
| 369 | IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView);
|
|---|
| 370 | IShellView_Release(fodInfos->Shell.FOIShellView);
|
|---|
| 371 | }
|
|---|
| 372 | fodInfos->Shell.FOIShellView = psvTmp;
|
|---|
| 373 |
|
|---|
| 374 | /* Release old FOIShellFolder and update its value */
|
|---|
| 375 | if (fodInfos->Shell.FOIShellFolder)
|
|---|
| 376 | IShellFolder_Release(fodInfos->Shell.FOIShellFolder);
|
|---|
| 377 | fodInfos->Shell.FOIShellFolder = psfTmp;
|
|---|
| 378 |
|
|---|
| 379 | /* Release old pidlAbsCurrent and update its value */
|
|---|
| 380 | COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent);
|
|---|
| 381 | fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp;
|
|---|
| 382 |
|
|---|
| 383 | COMDLG32_UpdateCurrentDir(fodInfos);
|
|---|
| 384 |
|
|---|
| 385 | /* Create the window */
|
|---|
| 386 | TRACE("create view window\n");
|
|---|
| 387 | if(FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL,
|
|---|
| 388 | &fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser,
|
|---|
| 389 | &fodInfos->ShellInfos.rectView, &hwndView))) goto error;
|
|---|
| 390 |
|
|---|
| 391 | fodInfos->ShellInfos.hwndView = hwndView;
|
|---|
| 392 |
|
|---|
| 393 | /* Select the new folder in the Look In combo box of the Open file dialog */
|
|---|
| 394 | FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent);
|
|---|
| 395 |
|
|---|
| 396 | /* changes the tab order of the ListView to reflect the window's File Dialog */
|
|---|
| 397 | hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN);
|
|---|
| 398 | SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE);
|
|---|
| 399 |
|
|---|
| 400 | /* Since we destroyed the old view if it had focus set focus to the newly created view */
|
|---|
| 401 | if (bViewHasFocus)
|
|---|
| 402 | SetFocus(fodInfos->ShellInfos.hwndView);
|
|---|
| 403 |
|
|---|
| 404 | return hRes;
|
|---|
| 405 | error:
|
|---|
| 406 | ERR("Failed with error 0x%08lx\n", hRes);
|
|---|
| 407 | return hRes;
|
|---|
| 408 | }
|
|---|
| 409 |
|
|---|
| 410 | /**************************************************************************
|
|---|
| 411 | * IShellBrowserImpl_EnableModelessSB
|
|---|
| 412 | */
|
|---|
| 413 | HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface,
|
|---|
| 414 | BOOL fEnable)
|
|---|
| 415 |
|
|---|
| 416 | {
|
|---|
| 417 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 418 |
|
|---|
| 419 | TRACE("(%p)\n", This);
|
|---|
| 420 |
|
|---|
| 421 | /* Feature not implemented */
|
|---|
| 422 | return E_NOTIMPL;
|
|---|
| 423 | }
|
|---|
| 424 |
|
|---|
| 425 | /**************************************************************************
|
|---|
| 426 | * IShellBrowserImpl_GetControlWindow
|
|---|
| 427 | */
|
|---|
| 428 | HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface,
|
|---|
| 429 | UINT id,
|
|---|
| 430 | HWND *lphwnd)
|
|---|
| 431 |
|
|---|
| 432 | {
|
|---|
| 433 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 434 |
|
|---|
| 435 | TRACE("(%p)\n", This);
|
|---|
| 436 |
|
|---|
| 437 | /* Feature not implemented */
|
|---|
| 438 | return E_NOTIMPL;
|
|---|
| 439 | }
|
|---|
| 440 | /**************************************************************************
|
|---|
| 441 | * IShellBrowserImpl_GetViewStateStream
|
|---|
| 442 | */
|
|---|
| 443 | HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface,
|
|---|
| 444 | DWORD grfMode,
|
|---|
| 445 | LPSTREAM *ppStrm)
|
|---|
| 446 |
|
|---|
| 447 | {
|
|---|
| 448 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 449 |
|
|---|
| 450 | FIXME("(%p 0x%08lx %p)\n", This, grfMode, ppStrm);
|
|---|
| 451 |
|
|---|
| 452 | /* Feature not implemented */
|
|---|
| 453 | return E_NOTIMPL;
|
|---|
| 454 | }
|
|---|
| 455 | /**************************************************************************
|
|---|
| 456 | * IShellBrowserImpl_InsertMenusSB
|
|---|
| 457 | */
|
|---|
| 458 | HRESULT WINAPI IShellBrowserImpl_InsertMenusSB(IShellBrowser *iface,
|
|---|
| 459 | HMENU hmenuShared,
|
|---|
| 460 | LPOLEMENUGROUPWIDTHS lpMenuWidths)
|
|---|
| 461 |
|
|---|
| 462 | {
|
|---|
| 463 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 464 |
|
|---|
| 465 | TRACE("(%p)\n", This);
|
|---|
| 466 |
|
|---|
| 467 | /* Feature not implemented */
|
|---|
| 468 | return E_NOTIMPL;
|
|---|
| 469 | }
|
|---|
| 470 | /**************************************************************************
|
|---|
| 471 | * IShellBrowserImpl_OnViewWindowActive
|
|---|
| 472 | */
|
|---|
| 473 | HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface,
|
|---|
| 474 | IShellView *ppshv)
|
|---|
| 475 |
|
|---|
| 476 | {
|
|---|
| 477 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 478 |
|
|---|
| 479 | TRACE("(%p)\n", This);
|
|---|
| 480 |
|
|---|
| 481 | /* Feature not implemented */
|
|---|
| 482 | return E_NOTIMPL;
|
|---|
| 483 | }
|
|---|
| 484 | /**************************************************************************
|
|---|
| 485 | * IShellBrowserImpl_QueryActiveShellView
|
|---|
| 486 | */
|
|---|
| 487 | HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface,
|
|---|
| 488 | IShellView **ppshv)
|
|---|
| 489 |
|
|---|
| 490 | {
|
|---|
| 491 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 492 |
|
|---|
| 493 | FileOpenDlgInfos *fodInfos;
|
|---|
| 494 |
|
|---|
| 495 | TRACE("(%p)\n", This);
|
|---|
| 496 |
|
|---|
| 497 | fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 498 |
|
|---|
| 499 | if(!(*ppshv = fodInfos->Shell.FOIShellView))
|
|---|
| 500 | {
|
|---|
| 501 | return E_FAIL;
|
|---|
| 502 | }
|
|---|
| 503 | IShellView_AddRef(fodInfos->Shell.FOIShellView);
|
|---|
| 504 | return NOERROR;
|
|---|
| 505 | }
|
|---|
| 506 | /**************************************************************************
|
|---|
| 507 | * IShellBrowserImpl_RemoveMenusSB
|
|---|
| 508 | */
|
|---|
| 509 | HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface,
|
|---|
| 510 | HMENU hmenuShared)
|
|---|
| 511 |
|
|---|
| 512 | {
|
|---|
| 513 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 514 |
|
|---|
| 515 | TRACE("(%p)\n", This);
|
|---|
| 516 |
|
|---|
| 517 | /* Feature not implemented */
|
|---|
| 518 | return E_NOTIMPL;
|
|---|
| 519 | }
|
|---|
| 520 | /**************************************************************************
|
|---|
| 521 | * IShellBrowserImpl_SendControlMsg
|
|---|
| 522 | */
|
|---|
| 523 | HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface,
|
|---|
| 524 | UINT id,
|
|---|
| 525 | UINT uMsg,
|
|---|
| 526 | WPARAM wParam,
|
|---|
| 527 | LPARAM lParam,
|
|---|
| 528 | LRESULT *pret)
|
|---|
| 529 |
|
|---|
| 530 | {
|
|---|
| 531 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 532 | LRESULT lres;
|
|---|
| 533 |
|
|---|
| 534 | TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret);
|
|---|
| 535 |
|
|---|
| 536 | switch (id)
|
|---|
| 537 | {
|
|---|
| 538 | case FCW_TOOLBAR:
|
|---|
| 539 | lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam);
|
|---|
| 540 | break;
|
|---|
| 541 | default:
|
|---|
| 542 | FIXME("ctrl id: %x\n", id);
|
|---|
| 543 | return E_NOTIMPL;
|
|---|
| 544 | }
|
|---|
| 545 | if (pret) *pret = lres;
|
|---|
| 546 | return S_OK;
|
|---|
| 547 | }
|
|---|
| 548 | /**************************************************************************
|
|---|
| 549 | * IShellBrowserImpl_SetMenuSB
|
|---|
| 550 | */
|
|---|
| 551 | HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface,
|
|---|
| 552 | HMENU hmenuShared,
|
|---|
| 553 | HOLEMENU holemenuReserved,
|
|---|
| 554 | HWND hwndActiveObject)
|
|---|
| 555 |
|
|---|
| 556 | {
|
|---|
| 557 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 558 |
|
|---|
| 559 | TRACE("(%p)\n", This);
|
|---|
| 560 |
|
|---|
| 561 | /* Feature not implemented */
|
|---|
| 562 | return E_NOTIMPL;
|
|---|
| 563 | }
|
|---|
| 564 | /**************************************************************************
|
|---|
| 565 | * IShellBrowserImpl_SetStatusTextSB
|
|---|
| 566 | */
|
|---|
| 567 | HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface,
|
|---|
| 568 | LPCOLESTR lpszStatusText)
|
|---|
| 569 |
|
|---|
| 570 | {
|
|---|
| 571 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 572 |
|
|---|
| 573 | TRACE("(%p)\n", This);
|
|---|
| 574 |
|
|---|
| 575 | /* Feature not implemented */
|
|---|
| 576 | return E_NOTIMPL;
|
|---|
| 577 | }
|
|---|
| 578 | /**************************************************************************
|
|---|
| 579 | * IShellBrowserImpl_SetToolbarItems
|
|---|
| 580 | */
|
|---|
| 581 | HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface,
|
|---|
| 582 | LPTBBUTTON lpButtons,
|
|---|
| 583 | UINT nButtons,
|
|---|
| 584 | UINT uFlags)
|
|---|
| 585 |
|
|---|
| 586 | {
|
|---|
| 587 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 588 |
|
|---|
| 589 | TRACE("(%p)\n", This);
|
|---|
| 590 |
|
|---|
| 591 | /* Feature not implemented */
|
|---|
| 592 | return E_NOTIMPL;
|
|---|
| 593 | }
|
|---|
| 594 | /**************************************************************************
|
|---|
| 595 | * IShellBrowserImpl_TranslateAcceleratorSB
|
|---|
| 596 | */
|
|---|
| 597 | HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface,
|
|---|
| 598 | LPMSG lpmsg,
|
|---|
| 599 | WORD wID)
|
|---|
| 600 |
|
|---|
| 601 | {
|
|---|
| 602 | ICOM_THIS(IShellBrowserImpl, iface);
|
|---|
| 603 |
|
|---|
| 604 | TRACE("(%p)\n", This);
|
|---|
| 605 |
|
|---|
| 606 | /* Feature not implemented */
|
|---|
| 607 | return E_NOTIMPL;
|
|---|
| 608 | }
|
|---|
| 609 |
|
|---|
| 610 | static ICOM_VTABLE(IShellBrowser) IShellBrowserImpl_Vtbl =
|
|---|
| 611 | {
|
|---|
| 612 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|---|
| 613 | /* IUnknown */
|
|---|
| 614 | IShellBrowserImpl_QueryInterface,
|
|---|
| 615 | IShellBrowserImpl_AddRef,
|
|---|
| 616 | IShellBrowserImpl_Release,
|
|---|
| 617 | /* IOleWindow */
|
|---|
| 618 | IShellBrowserImpl_GetWindow,
|
|---|
| 619 | IShellBrowserImpl_ContextSensitiveHelp,
|
|---|
| 620 | /* IShellBrowser */
|
|---|
| 621 | IShellBrowserImpl_InsertMenusSB,
|
|---|
| 622 | IShellBrowserImpl_SetMenuSB,
|
|---|
| 623 | IShellBrowserImpl_RemoveMenusSB,
|
|---|
| 624 | IShellBrowserImpl_SetStatusTextSB,
|
|---|
| 625 | IShellBrowserImpl_EnableModelessSB,
|
|---|
| 626 | IShellBrowserImpl_TranslateAcceleratorSB,
|
|---|
| 627 | IShellBrowserImpl_BrowseObject,
|
|---|
| 628 | IShellBrowserImpl_GetViewStateStream,
|
|---|
| 629 | IShellBrowserImpl_GetControlWindow,
|
|---|
| 630 | IShellBrowserImpl_SendControlMsg,
|
|---|
| 631 | IShellBrowserImpl_QueryActiveShellView,
|
|---|
| 632 | IShellBrowserImpl_OnViewWindowActive,
|
|---|
| 633 | IShellBrowserImpl_SetToolbarItems
|
|---|
| 634 | };
|
|---|
| 635 |
|
|---|
| 636 |
|
|---|
| 637 |
|
|---|
| 638 | /*
|
|---|
| 639 | * ICommDlgBrowser
|
|---|
| 640 | */
|
|---|
| 641 |
|
|---|
| 642 | /***************************************************************************
|
|---|
| 643 | * IShellBrowserImpl_ICommDlgBrowser_QueryInterface
|
|---|
| 644 | */
|
|---|
| 645 | HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
|
|---|
| 646 | ICommDlgBrowser *iface,
|
|---|
| 647 | REFIID riid,
|
|---|
| 648 | LPVOID *ppvObj)
|
|---|
| 649 | {
|
|---|
| 650 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
|---|
| 651 |
|
|---|
| 652 | TRACE("(%p)\n", This);
|
|---|
| 653 |
|
|---|
| 654 | return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
|
|---|
| 655 | }
|
|---|
| 656 |
|
|---|
| 657 | /**************************************************************************
|
|---|
| 658 | * IShellBrowserImpl_ICommDlgBrowser_AddRef
|
|---|
| 659 | */
|
|---|
| 660 | ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
|
|---|
| 661 | {
|
|---|
| 662 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
|---|
| 663 |
|
|---|
| 664 | TRACE("(%p)\n", This);
|
|---|
| 665 |
|
|---|
| 666 | return IShellBrowserImpl_AddRef(This);
|
|---|
| 667 | }
|
|---|
| 668 |
|
|---|
| 669 | /**************************************************************************
|
|---|
| 670 | * IShellBrowserImpl_ICommDlgBrowser_Release
|
|---|
| 671 | */
|
|---|
| 672 | ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
|
|---|
| 673 | {
|
|---|
| 674 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
|---|
| 675 |
|
|---|
| 676 | TRACE("(%p)\n", This);
|
|---|
| 677 |
|
|---|
| 678 | return IShellBrowserImpl_Release(This);
|
|---|
| 679 | }
|
|---|
| 680 | /**************************************************************************
|
|---|
| 681 | * IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand
|
|---|
| 682 | *
|
|---|
| 683 | * Called when a user double-clicks in the view or presses the ENTER key
|
|---|
| 684 | */
|
|---|
| 685 | HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDlgBrowser *iface,
|
|---|
| 686 | IShellView *ppshv)
|
|---|
| 687 | {
|
|---|
| 688 | LPITEMIDLIST pidl;
|
|---|
| 689 | FileOpenDlgInfos *fodInfos;
|
|---|
| 690 |
|
|---|
| 691 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
|---|
| 692 |
|
|---|
| 693 | TRACE("(%p)\n", This);
|
|---|
| 694 |
|
|---|
| 695 | fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 696 |
|
|---|
| 697 | /* If the selected object is not a folder, send a IDOK command to parent window */
|
|---|
| 698 | if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1)))
|
|---|
| 699 | {
|
|---|
| 700 | HRESULT hRes;
|
|---|
| 701 |
|
|---|
| 702 | ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;
|
|---|
| 703 | IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
|
|---|
| 704 | if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) )
|
|---|
| 705 | {
|
|---|
| 706 | hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE);
|
|---|
| 707 | }
|
|---|
| 708 | else
|
|---|
| 709 | {
|
|---|
| 710 | /* Tell the dialog that the user selected a file */
|
|---|
| 711 | hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L);
|
|---|
| 712 | }
|
|---|
| 713 |
|
|---|
| 714 | /* Free memory used by pidl */
|
|---|
| 715 | COMDLG32_SHFree((LPVOID)pidl);
|
|---|
| 716 |
|
|---|
| 717 | return hRes;
|
|---|
| 718 | }
|
|---|
| 719 |
|
|---|
| 720 | return E_FAIL;
|
|---|
| 721 | }
|
|---|
| 722 |
|
|---|
| 723 | /**************************************************************************
|
|---|
| 724 | * IShellBrowserImpl_ICommDlgBrowser_OnStateChange
|
|---|
| 725 | */
|
|---|
| 726 | HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBrowser *iface,
|
|---|
| 727 | IShellView *ppshv,
|
|---|
| 728 | ULONG uChange)
|
|---|
| 729 | {
|
|---|
| 730 |
|
|---|
| 731 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
|---|
| 732 |
|
|---|
| 733 | TRACE("(%p shv=%p)\n", This, ppshv);
|
|---|
| 734 |
|
|---|
| 735 | switch (uChange)
|
|---|
| 736 | {
|
|---|
| 737 | case CDBOSC_SETFOCUS:
|
|---|
| 738 | /* FIXME: Reset the default button.
|
|---|
| 739 | This should be taken care of by defdlg. If control
|
|---|
| 740 | other than button receives focus the default button
|
|---|
| 741 | should be restored. */
|
|---|
| 742 | SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0);
|
|---|
| 743 |
|
|---|
| 744 | break;
|
|---|
| 745 | case CDBOSC_KILLFOCUS:
|
|---|
| 746 | {
|
|---|
| 747 | FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 748 | if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)
|
|---|
| 749 | SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save");
|
|---|
| 750 | }
|
|---|
| 751 | break;
|
|---|
| 752 | case CDBOSC_SELCHANGE:
|
|---|
| 753 | return IShellBrowserImpl_ICommDlgBrowser_OnSelChange(iface,ppshv);
|
|---|
| 754 | case CDBOSC_RENAME:
|
|---|
| 755 | /* nothing to do */
|
|---|
| 756 | break;
|
|---|
| 757 | }
|
|---|
| 758 |
|
|---|
| 759 | return NOERROR;
|
|---|
| 760 | }
|
|---|
| 761 |
|
|---|
| 762 | /**************************************************************************
|
|---|
| 763 | * IShellBrowserImpl_ICommDlgBrowser_IncludeObject
|
|---|
| 764 | */
|
|---|
| 765 | HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface,
|
|---|
| 766 | IShellView * ppshv,
|
|---|
| 767 | LPCITEMIDLIST pidl)
|
|---|
| 768 | {
|
|---|
| 769 | FileOpenDlgInfos *fodInfos;
|
|---|
| 770 | ULONG ulAttr;
|
|---|
| 771 | STRRET str;
|
|---|
| 772 | WCHAR szPathW[MAX_PATH];
|
|---|
| 773 |
|
|---|
| 774 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
|---|
| 775 |
|
|---|
| 776 | TRACE("(%p)\n", This);
|
|---|
| 777 |
|
|---|
| 778 | fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 779 |
|
|---|
| 780 | ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK;
|
|---|
| 781 | IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr);
|
|---|
| 782 |
|
|---|
| 783 | if( (ulAttr & SFGAO_HIDDEN) /* hidden */
|
|---|
| 784 | | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */
|
|---|
| 785 | return S_FALSE;
|
|---|
| 786 |
|
|---|
| 787 | /* always include directorys and links */
|
|---|
| 788 | if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK))
|
|---|
| 789 | return S_OK;
|
|---|
| 790 |
|
|---|
| 791 | /* Check if there is a mask to apply if not */
|
|---|
| 792 | if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter))
|
|---|
| 793 | return S_OK;
|
|---|
| 794 |
|
|---|
| 795 | if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str)))
|
|---|
| 796 | {
|
|---|
| 797 | if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl)))
|
|---|
| 798 | {
|
|---|
| 799 | if (PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter))
|
|---|
| 800 | return S_OK;
|
|---|
| 801 | }
|
|---|
| 802 | }
|
|---|
| 803 | return S_FALSE;
|
|---|
| 804 |
|
|---|
| 805 | }
|
|---|
| 806 |
|
|---|
| 807 | /**************************************************************************
|
|---|
| 808 | * IShellBrowserImpl_ICommDlgBrowser_OnSelChange
|
|---|
| 809 | */
|
|---|
| 810 | HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv)
|
|---|
| 811 | {
|
|---|
| 812 | FileOpenDlgInfos *fodInfos;
|
|---|
| 813 |
|
|---|
| 814 | _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
|---|
| 815 |
|
|---|
| 816 | fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
|---|
| 817 | TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
|
|---|
| 818 |
|
|---|
| 819 | /* release old selections */
|
|---|
| 820 | if (fodInfos->Shell.FOIDataObject)
|
|---|
| 821 | IDataObject_Release(fodInfos->Shell.FOIDataObject);
|
|---|
| 822 |
|
|---|
| 823 | /* get a new DataObject from the ShellView */
|
|---|
| 824 | if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION,
|
|---|
| 825 | &IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject)))
|
|---|
| 826 | return E_FAIL;
|
|---|
| 827 |
|
|---|
| 828 | FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner);
|
|---|
| 829 |
|
|---|
| 830 | SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE);
|
|---|
| 831 | return S_OK;
|
|---|
| 832 | }
|
|---|
| 833 |
|
|---|
| 834 | static ICOM_VTABLE(ICommDlgBrowser) IShellBrowserImpl_ICommDlgBrowser_Vtbl =
|
|---|
| 835 | {
|
|---|
| 836 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|---|
| 837 | /* IUnknown */
|
|---|
| 838 | IShellBrowserImpl_ICommDlgBrowser_QueryInterface,
|
|---|
| 839 | IShellBrowserImpl_ICommDlgBrowser_AddRef,
|
|---|
| 840 | IShellBrowserImpl_ICommDlgBrowser_Release,
|
|---|
| 841 | /* ICommDlgBrowser */
|
|---|
| 842 | IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand,
|
|---|
| 843 | IShellBrowserImpl_ICommDlgBrowser_OnStateChange,
|
|---|
| 844 | IShellBrowserImpl_ICommDlgBrowser_IncludeObject
|
|---|
| 845 | };
|
|---|
| 846 |
|
|---|
| 847 |
|
|---|
| 848 |
|
|---|
| 849 |
|
|---|
| 850 | /*
|
|---|
| 851 | * IServiceProvider
|
|---|
| 852 | */
|
|---|
| 853 |
|
|---|
| 854 | /***************************************************************************
|
|---|
| 855 | * IShellBrowserImpl_IServiceProvider_QueryInterface
|
|---|
| 856 | */
|
|---|
| 857 | HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
|
|---|
| 858 | IServiceProvider *iface,
|
|---|
| 859 | REFIID riid,
|
|---|
| 860 | LPVOID *ppvObj)
|
|---|
| 861 | {
|
|---|
| 862 | _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
|---|
| 863 |
|
|---|
| 864 | FIXME("(%p)\n", This);
|
|---|
| 865 |
|
|---|
| 866 | return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
|
|---|
| 867 | }
|
|---|
| 868 |
|
|---|
| 869 | /**************************************************************************
|
|---|
| 870 | * IShellBrowserImpl_IServiceProvider_AddRef
|
|---|
| 871 | */
|
|---|
| 872 | ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
|
|---|
| 873 | {
|
|---|
| 874 | _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
|---|
| 875 |
|
|---|
| 876 | FIXME("(%p)\n", This);
|
|---|
| 877 |
|
|---|
| 878 | return IShellBrowserImpl_AddRef(This);
|
|---|
| 879 | }
|
|---|
| 880 |
|
|---|
| 881 | /**************************************************************************
|
|---|
| 882 | * IShellBrowserImpl_IServiceProvider_Release
|
|---|
| 883 | */
|
|---|
| 884 | ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
|
|---|
| 885 | {
|
|---|
| 886 | _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
|---|
| 887 |
|
|---|
| 888 | FIXME("(%p)\n", This);
|
|---|
| 889 |
|
|---|
| 890 | return IShellBrowserImpl_Release(This);
|
|---|
| 891 | }
|
|---|
| 892 |
|
|---|
| 893 | /**************************************************************************
|
|---|
| 894 | * IShellBrowserImpl_IServiceProvider_Release
|
|---|
| 895 | *
|
|---|
| 896 | * NOTES
|
|---|
| 897 | * the w2k shellview asks for
|
|---|
| 898 | * guidService = SID_STopLevelBrowser
|
|---|
| 899 | * riid = IShellBrowser
|
|---|
| 900 | *
|
|---|
| 901 | * FIXME
|
|---|
| 902 | * this is a hack!
|
|---|
| 903 | */
|
|---|
| 904 |
|
|---|
| 905 | HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
|
|---|
| 906 | IServiceProvider * iface,
|
|---|
| 907 | REFGUID guidService,
|
|---|
| 908 | REFIID riid,
|
|---|
| 909 | void** ppv)
|
|---|
| 910 | {
|
|---|
| 911 | _ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
|---|
| 912 |
|
|---|
| 913 | FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
|
|---|
| 914 |
|
|---|
| 915 | *ppv = NULL;
|
|---|
| 916 | if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
|
|---|
| 917 | {
|
|---|
| 918 | return IShellBrowserImpl_QueryInterface(This,riid,ppv);
|
|---|
| 919 | }
|
|---|
| 920 | FIXME("(%p) unknown interface requested\n", This);
|
|---|
| 921 | return E_NOINTERFACE;
|
|---|
| 922 |
|
|---|
| 923 | }
|
|---|
| 924 |
|
|---|
| 925 | static ICOM_VTABLE(IServiceProvider) IShellBrowserImpl_IServiceProvider_Vtbl =
|
|---|
| 926 | {
|
|---|
| 927 | ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
|---|
| 928 | /* IUnknown */
|
|---|
| 929 | IShellBrowserImpl_IServiceProvider_QueryInterface,
|
|---|
| 930 | IShellBrowserImpl_IServiceProvider_AddRef,
|
|---|
| 931 | IShellBrowserImpl_IServiceProvider_Release,
|
|---|
| 932 | /* IServiceProvider */
|
|---|
| 933 | IShellBrowserImpl_IServiceProvider_QueryService
|
|---|
| 934 | };
|
|---|