26#define NONAMELESSUNION
42#define IDC_NAV_TOOLBAR 200
43#define IDC_NAVBACK 201
44#define IDC_NAVFORWARD 202
49DEFINE_GUID(IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0,0xAA, 0x2A,0x37,0x49,0x4E,0x60,0x6F);
54static const WCHAR floatnotifysinkW[] = {
'F',
'l',
'o',
'a',
't',
'N',
'o',
't',
'i',
'f',
'y',
'S',
'i',
'n',
'k',0};
55static const WCHAR radiobuttonlistW[] = {
'R',
'a',
'd',
'i',
'o',
'B',
'u',
't',
't',
'o',
'n',
'L',
'i',
's',
't',0};
91 struct list sub_cctrls_entry;
245 hr = IFileDialogEvents_OnOverwrite(
cursor->pfde, (
IFileDialog*)&
This->IFileDialog2_iface, shellitem, &response);
246 TRACE(
"<-- hr=%x response=%u\n",
hr, response);
278 return IFileDialogEvents_QueryInterface(pfde, &IID_IFileDialogControlEvents, (
void**)pfdce);
288 IFileDialogControlEvents *pfdce;
292 IFileDialogControlEvents_OnButtonClicked(pfdce, &
This->IFileDialogCustomize_iface, ctl_id);
293 IFileDialogControlEvents_Release(pfdce);
303 TRACE(
"%p %i %i\n",
This, ctl_id, item_id);
307 IFileDialogControlEvents *pfdce;
311 IFileDialogControlEvents_OnItemSelected(pfdce, &
This->IFileDialogCustomize_iface, ctl_id, item_id);
312 IFileDialogControlEvents_Release(pfdce);
326 IFileDialogControlEvents *pfdce;
330 IFileDialogControlEvents_OnCheckButtonToggled(pfdce, &
This->IFileDialogCustomize_iface, ctl_id, checked);
331 IFileDialogControlEvents_Release(pfdce);
346 IFileDialogControlEvents *pfdce;
350 IFileDialogControlEvents_OnControlActivating(pfdce, &
This->IFileDialogCustomize_iface, ctl_id);
351 IFileDialogControlEvents_Release(pfdce);
368 if(
This->set_filename)
389 if(
This->set_filename)
402 UINT item_count, valid_count;
405 if(!
This->psia_selection)
408 hr = IShellItemArray_GetCount(
This->psia_selection, &item_count);
415 valid_count = 0; len_total = 0;
416 for(
i = 0;
i < item_count;
i++)
418 hr = IShellItemArray_GetItemAt(
This->psia_selection,
i, &psi);
423 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER, &
attr);
425 (( (
This->options & FOS_PICKFOLDERS) && !(
attr & SFGAO_FOLDER)) ||
426 (!(
This->options & FOS_PICKFOLDERS) && (
attr & SFGAO_FOLDER))))
429 hr = IShellItem_GetDisplayName(psi, (
This->options & FOS_PICKFOLDERS) ? SIGDN_FILESYSPATH : SIGDN_PARENTRELATIVEPARSING, &
names[valid_count]);
435 IShellItem_Release(psi);
444 else if(valid_count > 1)
449 for(
i = 0;
i < valid_count;
i++)
459 *(cur_point-1) =
'\0';
490 hr = IShellItem_GetDisplayName(shellitem, SIGDN_FILESYSPATH, &
filename);
500 result =
SUCCEEDED(IShellItem_GetAttributes(shellitem, SFGAO_VALIDATE, &attributes));
523 if(!file_count)
return E_FAIL;
528 ERR(
"Failed to get pidl for current directory.\n");
533 TRACE(
"Acting on %d file(s).\n", file_count);
546 if( (
This->options & FOS_NOVALIDATE) &&
547 !(
This->options & FOS_FILEMUSTEXIST) )
553 This->options & ~FOS_FILEMUSTEXIST,
566 if(
This->filterspec_count)
570 else if(
This->default_ext)
586 if( !(
This->options & FOS_NOVALIDATE) && (
This->options & FOS_FILEMUSTEXIST) &&
589 if(
This->default_ext)
609 pidla[
i] = COMDLG32_SHSimpleIDListFromPathAW(canon_filename);
612 IShellFolder_Release(psf_parent);
626 FIXME(
"Filtering not implemented.\n");
630 hr = IExplorerBrowser_BrowseToObject(
This->peb, (
IUnknown*)psf_parent, SBSP_DEFBROWSER);
632 ERR(
"Failed to browse to directory: %08x\n",
hr);
634 IShellFolder_Release(psf_parent);
641 if(
This->psia_results)
643 IShellItemArray_Release(
This->psia_results);
648 &
This->psia_results);
650 IShellFolder_Release(psf_desktop);
655 if(
This->options & FOS_PICKFOLDERS)
658 hr = IShellItemArray_GetAttributes(
This->psia_results, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &attributes);
666 IShellItemArray_Release(
This->psia_results);
678 hr = IShellItemArray_GetItemAt(
This->psia_results,
i, &shellitem);
684 IShellItem_Release(shellitem);
703 for(
i = 0;
i < file_count;
i++)
726 This->opendropdown_has_selection =
TRUE;
731 This->opendropdown_selection = mii.
wID;
736 This->opendropdown_has_selection =
FALSE;
756 if (!position) position = &
dummy;
762 if (
item->id == itemid)
765 if ((
item->cdcstate & visible_flags) == visible_flags)
796 if (!
item || !label_copy)
806 item->label = label_copy;
825 if(
ctrl->dlgid == dlgid)
829 if(sub_ctrl->
dlgid == dlgid)
833 ERR(
"Failed to find control with dialog id %d\n", dlgid);
843 if(
ctrl->id == ctlid)
847 if(sub_ctrl->
id == ctlid)
851 if (
This->hmenu_opendropdown &&
This->cctrl_opendropdown.id == ctlid)
852 return &
This->cctrl_opendropdown;
854 TRACE(
"No existing control with control id %d\n", ctlid);
897 final_width =
min(
max(
size.cx, min_width) + 4, max_width);
1144 HWND ns_hwnd, control_hwnd, parent_hwnd;
1151 if(
This->cctrl_active_vg)
1152 parent_hwnd =
This->cctrl_active_vg->wrapper_hwnd;
1154 parent_hwnd =
This->cctrls_hwnd;
1157 0, 0,
This->cctrl_width,
height, parent_hwnd,
1163 if(!ns_hwnd || !control_hwnd)
1165 ERR(
"Failed to create wrapper (%p) or control (%p)\n", ns_hwnd, control_hwnd);
1178 ctrl->hwnd = control_hwnd;
1179 ctrl->wrapper_hwnd = ns_hwnd;
1181 ctrl->dlgid =
This->cctrl_next_dlgid;
1186 if(
This->cctrl_active_vg)
1193 if(ppctrl) *ppctrl =
ctrl;
1195 This->cctrl_next_dlgid++;
1204 UINT container_height;
1207 UINT max_control_height, total_height = 0;
1208 UINT cur_col_pos, cur_row_pos;
1221 column_width =
This->cctrl_width + cspacing;
1222 nr_of_cols = (container_width -
This->cctrl_indent + cspacing) / column_width;
1225 if(nr_of_cols ==
This->cctrls_cols)
1232 This->cctrls_cols = nr_of_cols;
1237 max_control_height = 0;
1243 max_control_height =
max(max_control_height, control_height);
1245 total_height += control_height + rspacing;
1252 container_height =
max(total_height / nr_of_cols, max_control_height + rspacing);
1253 TRACE(
"Guess: container_height: %d\n",container_height);
1259 UINT columns_needed = 1;
1269 if(cur_row_pos + control_height > container_height)
1271 if(++columns_needed > nr_of_cols)
1273 container_height += 1;
1274 fits_height =
FALSE;
1280 cur_row_pos += control_height + rspacing;
1283 }
while(!fits_height);
1285 TRACE(
"Final container height: %d\n", container_height);
1289 cur_col_pos = 0; cur_row_pos = 0;
1295 UINT control_height, control_indent;
1299 if(cur_row_pos + control_height > container_height)
1302 cur_col_pos +=
This->cctrl_width + cspacing;
1309 control_indent =
This->cctrl_indent;
1314 cur_row_pos += control_height + rspacing;
1319 if(cur_row_pos +
This->cctrl_width > container_width)
1320 ERR(
"-- Failed to place controls properly.\n");
1322 return container_height;
1366 ERR(
"Failed to get font handle from dialog.\n");
1445 ERR(
"Can't find this control\n");
1460 ERR(
"Can't find control item\n");
1497 static const WCHAR ctrl_container_classname[] =
1498 {
'i',
'd',
'l',
'g',
'_',
'c',
'o',
'n',
't',
'a',
'i',
'n',
'e',
'r',
'_',
'p',
'a',
'n',
'e',0};
1520 0, 0, 0, 0,
NULL, 0,
1522 if(!
This->cctrls_hwnd)
1533 This->cctrls_cols = 0;
1535 This->cctrl_next_dlgid = 0x2000;
1557 ERR(
"Failed to register FloatNotifySink window class.\n");
1575 ERR(
"Failed to register RadioButtonList window class.\n");
1588 HWND open_hwnd, dropdown_hwnd;
1590 if (
This->hmenu_opendropdown)
1592 INT num_visible_items=0;
1599 num_visible_items++;
1600 if (num_visible_items >= 2)
1614 if (showing != show)
1616 RECT open_rc, dropdown_rc;
1647 RECT cancel_rc, dropdown_rc, open_rc;
1648 RECT filetype_rc, filename_rc, filenamelabel_rc;
1649 RECT toolbar_rc, ebrowser_rc, customctrls_rc;
1650 static const UINT vspacing = 4, hspacing = 4;
1651 static const UINT min_width = 320, min_height = 200;
1656 TRACE(
"Invalid dialog window, not updating layout\n");
1660 if(dialog_rc.
right < min_width || dialog_rc.
bottom < min_height)
1662 TRACE(
"Dialog size (%d, %d) too small, not updating layout\n", dialog_rc.
right, dialog_rc.
bottom);
1674 int cancel_width, cancel_height;
1676 cancel_width = cancel_rc.
right - cancel_rc.
left;
1677 cancel_height = cancel_rc.
bottom - cancel_rc.
top;
1679 cancel_rc.
left = dialog_rc.
right - cancel_width - hspacing;
1680 cancel_rc.
top = dialog_rc.
bottom - cancel_height - vspacing;
1681 cancel_rc.
right = cancel_rc.
left + cancel_width;
1682 cancel_rc.
bottom = cancel_rc.
top + cancel_height;
1690 int dropdown_width, dropdown_height;
1694 dropdown_width = dropdown_rc.
right - dropdown_rc.
left;
1695 dropdown_height = dropdown_rc.
bottom - dropdown_rc.
top;
1697 dropdown_rc.
left = cancel_rc.
left - dropdown_width - hspacing;
1698 dropdown_rc.
top = cancel_rc.
top;
1699 dropdown_rc.
right = dropdown_rc.
left + dropdown_width;
1700 dropdown_rc.
bottom = dropdown_rc.
top + dropdown_height;
1704 dropdown_rc.
left = dropdown_rc.
right = cancel_rc.
left - hspacing;
1705 dropdown_rc.
top = cancel_rc.
top;
1713 int open_width, open_height;
1715 open_width = open_rc.
right - open_rc.
left;
1716 open_height = open_rc.
bottom - open_rc.
top;
1718 open_rc.
left = dropdown_rc.
left - open_width;
1719 open_rc.
top = dropdown_rc.
top;
1720 open_rc.
right = open_rc.
left + open_width;
1721 open_rc.
bottom = open_rc.
top + open_height;
1728 int filetype_width, filetype_height;
1731 filetype_width = filetype_rc.
right - filetype_rc.
left;
1732 filetype_height = filetype_rc.
bottom - filetype_rc.
top;
1736 filetype_rc.
left = filetype_rc.
right - filetype_width;
1737 filetype_rc.
top = cancel_rc.
top - filetype_height - vspacing;
1738 filetype_rc.
bottom = filetype_rc.
top + filetype_height;
1740 if(!
This->filterspec_count)
1748 int filetypelabel_width, filetypelabel_height;
1751 filetypelabel_width = filenamelabel_rc.
right - filenamelabel_rc.
left;
1752 filetypelabel_height = filenamelabel_rc.
bottom - filenamelabel_rc.
top;
1754 filenamelabel_rc.
left = 160;
1755 filenamelabel_rc.
top = filetype_rc.
top;
1756 filenamelabel_rc.
right = filenamelabel_rc.
left + filetypelabel_width;
1757 filenamelabel_rc.
bottom = filenamelabel_rc.
top + filetypelabel_height;
1764 int filename_width, filename_height;
1767 filename_width = filetype_rc.
left - filenamelabel_rc.
right - hspacing*2;
1768 filename_height = filename_rc.
bottom - filename_rc.
top;
1770 filename_rc.
left = filenamelabel_rc.
right + hspacing;
1771 filename_rc.
top = filetype_rc.
top;
1772 filename_rc.
right = filename_rc.
left + filename_width;
1773 filename_rc.
bottom = filename_rc.
top + filename_height;
1784 customctrls_rc.
left = dialog_rc.
left + hspacing;
1785 customctrls_rc.
right = dialog_rc.
right - hspacing;
1786 customctrls_rc.
bottom = filename_rc.
top - vspacing;
1787 customctrls_rc.
top = customctrls_rc.
bottom -
1791 ebrowser_rc.
left = dialog_rc.
left + hspacing;
1792 ebrowser_rc.
top = toolbar_rc.
bottom + vspacing;
1793 ebrowser_rc.
right = dialog_rc.
right - hspacing;
1794 ebrowser_rc.
bottom = customctrls_rc.
top - vspacing;
1803 if(hdwp &&
This->peb)
1804 IExplorerBrowser_SetRect(
This->peb, &hdwp, ebrowser_rc);
1806 if(hdwp &&
This->cctrls_hwnd)
1808 customctrls_rc.
left, customctrls_rc.
top,
1809 customctrls_rc.
right - customctrls_rc.
left, customctrls_rc.
bottom - customctrls_rc.
top,
1841 ERR(
"Failed to position dialog controls.\n");
1858 &IID_IExplorerBrowser, (
void**)&
This->peb);
1861 ERR(
"Failed to instantiate ExplorerBrowser control.\n");
1867 hr = IExplorerBrowser_Initialize(
This->peb,
This->dlg_hwnd, &rc,
NULL);
1870 ERR(
"Failed to initialize the ExplorerBrowser control.\n");
1871 IExplorerBrowser_Release(
This->peb);
1875 hr = IExplorerBrowser_Advise(
This->peb, &
This->IExplorerBrowserEvents_iface, &
This->ebevents_cookie);
1877 ERR(
"Advise (ExplorerBrowser) failed.\n");
1881 if(!(
This->options & FOS_ALLOWMULTISELECT))
1884 IExplorerBrowser_SetFolderSettings(
This->peb, &fos);
1890 IObjectWithSite_Release(
client);
1892 ERR(
"SetSite failed, 0x%08x\n",
hr);
1896 psi_folder =
This->psi_setfolder ?
This->psi_setfolder :
This->psi_defaultfolder;
1897 IExplorerBrowser_BrowseToObject(
This->peb, (
IUnknown*)psi_folder, SBSP_DEFBROWSER);
1943 if(
This->custom_title)
1947 custom_okbutton =
item->label;
1949 custom_okbutton =
This->custom_okbutton;
1951 if(custom_okbutton &&
1958 if(
This->custom_cancelbutton &&
1965 if(
This->custom_filenamelabel &&
1975 static const WCHAR prop_this[] = {
'i',
't',
'e',
'm',
'd',
'l',
'g',
'_',
'T',
'h',
'i',
's',0};
1976 static const WCHAR prop_oldwndproc[] = {
'i',
't',
'e',
'm',
'd',
'l',
'g',
'_',
'o',
'l',
'd',
'w',
'n',
'd',
'p',
'r',
'o',
'c',0};
2010 if(
This->filterspec_count)
2015 UINT i, maxwidth = 0;
2021 for(
i = 0;
i <
This->filterspec_count;
i++)
2026 maxwidth =
max(maxwidth,
size.cx);
2036 ERR(
"Failed to calculate width of filetype dropdown\n");
2043 if(
This->set_filename &&
2047 if(
This->hmenu_opendropdown)
2052 static const WCHAR marlett[] = {
'M',
'a',
'r',
'l',
'e',
't',
't',0};
2053 static const WCHAR prop_this[] = {
'i',
't',
'e',
'm',
'd',
'l',
'g',
'_',
'T',
'h',
'i',
's',0};
2054 static const WCHAR prop_oldwndproc[] = {
'i',
't',
'e',
'm',
'd',
'l',
'g',
'_',
'o',
'l',
'd',
'w',
'n',
'd',
'p',
'r',
'o',
'c',0};
2063 memset(&lfw_marlett, 0,
sizeof(lfw_marlett));
2074 SetPropW(dropdown_hwnd, prop_oldwndproc,
2084 if(
This->filterspec_count)
2117 IExplorerBrowser_Destroy(
This->peb);
2118 IExplorerBrowser_Release(
This->peb);
2166 IExplorerBrowser_BrowseToIDList(
This->peb,
NULL, SBSP_NAVIGATEBACK);
2173 IExplorerBrowser_BrowseToIDList(
This->peb,
NULL, SBSP_NAVIGATEFORWARD);
2184 UINT prev_index =
This->filetypeindex;
2187 TRACE(
"File type selection changed to %d.\n",
This->filetypeindex);
2189 if(prev_index ==
This->filetypeindex)
2192 hr = IExplorerBrowser_GetCurrentView(
This->peb, &IID_IShellView, (
void**)&psv);
2195 IShellView_Refresh(psv);
2196 IShellView_Release(psv);
2236 default:
TRACE(
"Unknown command.\n");
2359 for(
i = 0;
i <
This->filterspec_count;
i++)
2368 if(
This->psi_defaultfolder) IShellItem_Release(
This->psi_defaultfolder);
2369 if(
This->psi_setfolder) IShellItem_Release(
This->psi_setfolder);
2370 if(
This->psi_folder) IShellItem_Release(
This->psi_folder);
2371 if(
This->psia_selection) IShellItemArray_Release(
This->psia_selection);
2372 if(
This->psia_results) IShellItemArray_Release(
This->psia_results);
2393 TRACE(
"%p (%p)\n", iface, hwndOwner);
2395 This->opendropdown_has_selection =
FALSE;
2405 TRACE(
"%p (%d, %p)\n",
This, cFileTypes, rgFilterSpec);
2407 if(
This->filterspecs)
2417 for(
i = 0;
i < cFileTypes;
i++)
2419 This->filterspecs[
i].pszName =
StrDupW(rgFilterSpec[
i].pszName);
2420 This->filterspecs[
i].pszSpec =
StrDupW(rgFilterSpec[
i].pszSpec);
2422 This->filterspec_count = cFileTypes;
2432 if(!
This->filterspecs)
2435 iFileType =
max(iFileType, 1);
2436 iFileType =
min(iFileType,
This->filterspec_count);
2437 This->filetypeindex = iFileType-1;
2450 if(
This->filterspec_count == 0)
2453 *piFileType =
This->filetypeindex + 1;
2462 TRACE(
"%p (%p, %p)\n",
This, pfde, pdwCookie);
2464 if(!pfde || !pdwCookie)
2471 IFileDialogEvents_AddRef(pfde);
2472 *pdwCookie =
client->cookie;
2487 if(
client->cookie == dwCookie)
2497 IFileDialogEvents_Release(found->
pfde);
2510 if (fos & ~(FOS_OVERWRITEPROMPT | FOS_STRICTFILETYPES | FOS_NOCHANGEDIR | FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM
2511 | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_ALLOWMULTISELECT | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST
2512 | FOS_CREATEPROMPT | FOS_SHAREAWARE | FOS_NOREADONLYRETURN | FOS_NOTESTFILECREATE | FOS_HIDEMRUPLACES
2513 | FOS_HIDEPINNEDPLACES | FOS_NODEREFERENCELINKS | FOS_DONTADDTORECENT | FOS_FORCESHOWHIDDEN
2514 | FOS_DEFAULTNOMINIMODE | FOS_FORCEPREVIEWPANEON | FOS_SUPPORTSTREAMABLEITEMS))
2516 WARN(
"Invalid option %#x\n", fos);
2520 if( !(
This->options & FOS_PICKFOLDERS) && (fos & FOS_PICKFOLDERS) )
2524 IFileDialog2_SetTitle(iface,
buf);
2527 This->options = fos;
2540 *pfos =
This->options;
2549 if(
This->psi_defaultfolder)
2550 IShellItem_Release(
This->psi_defaultfolder);
2552 This->psi_defaultfolder = psi;
2554 if(
This->psi_defaultfolder)
2555 IShellItem_AddRef(
This->psi_defaultfolder);
2564 if(
This->psi_setfolder)
2565 IShellItem_Release(
This->psi_setfolder);
2567 This->psi_setfolder = psi;
2569 if(
This->psi_setfolder)
2570 IShellItem_AddRef(
This->psi_setfolder);
2586 if(
This->psi_folder)
2587 *ppsi =
This->psi_folder;
2588 else if(
This->psi_setfolder)
2589 *ppsi =
This->psi_setfolder;
2590 else if(
This->psi_defaultfolder)
2591 *ppsi =
This->psi_defaultfolder;
2595 IShellItem_AddRef(*ppsi);
2611 if(
This->psia_selection)
2614 hr = IShellItemArray_GetItemAt(
This->psia_selection, 0, ppsi);
2634 TRACE(
"%p (%p)\n", iface, pszName);
2691 if(
This->psia_results)
2694 hr = IShellItemArray_GetCount(
This->psia_results, &item_count);
2701 hr = IShellItemArray_GetItemAt(
This->psia_results, 0, ppsi);
2713 FIXME(
"stub - %p (%p, %d)\n",
This, psi, fdap);
2757 FIXME(
"stub - %p (%p)\n",
This, pFilter);
2831 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
2837 return IFileDialog2_Release(&
This->IFileDialog2_iface);
2843 return IFileDialog2_Show(&
This->IFileDialog2_iface, hwndOwner);
2850 return IFileDialog2_SetFileTypes(&
This->IFileDialog2_iface, cFileTypes, rgFilterSpec);
2856 return IFileDialog2_SetFileTypeIndex(&
This->IFileDialog2_iface, iFileType);
2862 return IFileDialog2_GetFileTypeIndex(&
This->IFileDialog2_iface, piFileType);
2869 return IFileDialog2_Advise(&
This->IFileDialog2_iface, pfde, pdwCookie);
2875 return IFileDialog2_Unadvise(&
This->IFileDialog2_iface, dwCookie);
2881 return IFileDialog2_SetOptions(&
This->IFileDialog2_iface, fos);
2887 return IFileDialog2_GetOptions(&
This->IFileDialog2_iface, pfos);
2893 return IFileDialog2_SetDefaultFolder(&
This->IFileDialog2_iface, psi);
2899 return IFileDialog2_SetFolder(&
This->IFileDialog2_iface, psi);
2905 return IFileDialog2_GetFolder(&
This->IFileDialog2_iface, ppsi);
2911 return IFileDialog2_GetCurrentSelection(&
This->IFileDialog2_iface, ppsi);
2917 return IFileDialog2_SetFileName(&
This->IFileDialog2_iface, pszName);
2923 return IFileDialog2_GetFileName(&
This->IFileDialog2_iface, pszName);
2929 return IFileDialog2_SetTitle(&
This->IFileDialog2_iface, pszTitle);
2935 return IFileDialog2_SetOkButtonLabel(&
This->IFileDialog2_iface, pszText);
2941 return IFileDialog2_SetFileNameLabel(&
This->IFileDialog2_iface, pszLabel);
2947 return IFileDialog2_GetResult(&
This->IFileDialog2_iface, ppsi);
2953 return IFileDialog2_AddPlace(&
This->IFileDialog2_iface, psi, fdap);
2960 return IFileDialog2_SetDefaultExtension(&
This->IFileDialog2_iface, pszDefaultExtension);
2966 return IFileDialog2_Close(&
This->IFileDialog2_iface,
hr);
2972 return IFileDialog2_SetClientGuid(&
This->IFileDialog2_iface,
guid);
2978 return IFileDialog2_ClearClientData(&
This->IFileDialog2_iface);
2984 return IFileDialog2_SetFilter(&
This->IFileDialog2_iface, pFilter);
2992 *ppenum =
This->psia_results;
2996 IShellItemArray_AddRef(*ppenum);
3008 if(
This->psia_selection)
3010 *ppsai =
This->psia_selection;
3011 IShellItemArray_AddRef(*ppsai);
3069 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3075 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3081 return IFileDialog2_Show(&
This->IFileDialog2_iface, hwndOwner);
3088 return IFileDialog2_SetFileTypes(&
This->IFileDialog2_iface, cFileTypes, rgFilterSpec);
3094 return IFileDialog2_SetFileTypeIndex(&
This->IFileDialog2_iface, iFileType);
3100 return IFileDialog2_GetFileTypeIndex(&
This->IFileDialog2_iface, piFileType);
3107 return IFileDialog2_Advise(&
This->IFileDialog2_iface, pfde, pdwCookie);
3113 return IFileDialog2_Unadvise(&
This->IFileDialog2_iface, dwCookie);
3119 return IFileDialog2_SetOptions(&
This->IFileDialog2_iface, fos);
3125 return IFileDialog2_GetOptions(&
This->IFileDialog2_iface, pfos);
3131 return IFileDialog2_SetDefaultFolder(&
This->IFileDialog2_iface, psi);
3137 return IFileDialog2_SetFolder(&
This->IFileDialog2_iface, psi);
3143 return IFileDialog2_GetFolder(&
This->IFileDialog2_iface, ppsi);
3149 return IFileDialog2_GetCurrentSelection(&
This->IFileDialog2_iface, ppsi);
3155 return IFileDialog2_SetFileName(&
This->IFileDialog2_iface, pszName);
3161 return IFileDialog2_GetFileName(&
This->IFileDialog2_iface, pszName);
3167 return IFileDialog2_SetTitle(&
This->IFileDialog2_iface, pszTitle);
3173 return IFileDialog2_SetOkButtonLabel(&
This->IFileDialog2_iface, pszText);
3179 return IFileDialog2_SetFileNameLabel(&
This->IFileDialog2_iface, pszLabel);
3185 return IFileDialog2_GetResult(&
This->IFileDialog2_iface, ppsi);
3191 return IFileDialog2_AddPlace(&
This->IFileDialog2_iface, psi, fdap);
3198 return IFileDialog2_SetDefaultExtension(&
This->IFileDialog2_iface, pszDefaultExtension);
3204 return IFileDialog2_Close(&
This->IFileDialog2_iface,
hr);
3210 return IFileDialog2_SetClientGuid(&
This->IFileDialog2_iface,
guid);
3216 return IFileDialog2_ClearClientData(&
This->IFileDialog2_iface);
3222 return IFileDialog2_SetFilter(&
This->IFileDialog2_iface, pFilter);
3235 FIXME(
"stub - %p (%p)\n",
This, pStore);
3241 BOOL fAppendDefault)
3251 FIXME(
"stub - %p (%p)\n",
This, ppStore);
3262 FIXME(
"%p (%p, %p, %p, %p)\n",
This, psi, pStore,
hwnd, pSink);
3322 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3329 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3344 IShellItem_Release(psi);
3353 ERR(
"Failed to convert pidl (%p) to a shellitem.\n", pidlFolder);
3373 if(
This->psi_folder)
3374 IShellItem_Release(
This->psi_folder);
3379 ERR(
"Failed to get the current folder.\n");
3426 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3433 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3447 else if(
IsEqualGUID(guidService, &SID_SExplorerBrowserFrame))
3448 hr = IFileDialog2_QueryInterface(&
This->IFileDialog2_iface,
riid,
ppv);
3450 FIXME(
"Interface %s requested from unknown service %s\n",
3483 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3490 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3514 TRACE(
"%p (%p, %x)\n",
This, shv, uChange);
3518 case CDBOSC_SELCHANGE:
3519 if(
This->psia_selection)
3521 IShellItemArray_Release(
This->psia_selection);
3525 hr = IShellView_GetItemObject(shv, SVGIO_SELECTION, &
IID_IDataObject, (
void**)&new_selection);
3529 (
void**)&
This->psia_selection);
3536 IDataObject_Release(new_selection);
3540 TRACE(
"Unhandled state change\n");
3554 TRACE(
"%p (%p, %p)\n",
This, shv, pidl);
3556 if(!
This->filterspec_count && !(
This->options & FOS_PICKFOLDERS))
3569 ERR(
"Failed to get shellitem (%08x).\n",
hr);
3573 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER|SFGAO_LINK, &
attr);
3576 IShellItem_Release(psi);
3580 if((
This->options & FOS_PICKFOLDERS) && !(
attr & (SFGAO_FOLDER | SFGAO_LINK)))
3582 IShellItem_Release(psi);
3587 if(
SUCCEEDED(IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename)))
3594 IShellItem_Release(psi);
3602 FIXME(
"Stub: %p (%p, 0x%x)\n",
This, ppshv, dwNotifyType);
3618 FIXME(
"Stub: %p (%p)\n",
This, pdwFlags);
3626 FIXME(
"Stub: %p (%p, %d)\n",
This, pshv, iColumn);
3631 LPWSTR pszFileSpec,
int cchFileSpec)
3634 FIXME(
"Stub: %p (%p, %d)\n",
This, pszFileSpec, cchFileSpec);
3678 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3684 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3690 FIXME(
"Stub: %p (%d)\n",
This, fEnterMOde);
3698 *phwnd =
This->dlg_hwnd;
3728 return IFileDialog2_AddRef(&
This->IFileDialog2_iface);
3734 return IFileDialog2_Release(&
This->IFileDialog2_iface);
3749 if (!
This->hmenu_opendropdown)
3753 mi.fMask = MIM_STYLE;
3757 This->cctrl_opendropdown.hwnd =
NULL;
3758 This->cctrl_opendropdown.wrapper_hwnd =
NULL;
3759 This->cctrl_opendropdown.id = dwIDCtl;
3760 This->cctrl_opendropdown.dlgid = 0;
3777 TRACE(
"%p (%d, %p)\n",
This, dwIDCtl, pszLabel);
3808 TRACE(
"%p (%d, %p)\n",
This, dwIDCtl, pszLabel);