28#define IDT_CHANGEFILETYPE 500
29#define IDT_CLOSEDIALOG 501
30#define IDT_SHOWDIALOG 502
48#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
56DEFINE_GUID(IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0,0xAA, 0x2A,0x37,0x49,0x4E,0x60,0x6F);
103 hr = IOleWindow_GetWindow(
pow, &dlg_hwnd);
106 IOleWindow_Release(
pow);
137 ok(0,
"Unexpectedly called.\n");
170 This->OnFolderChanging++;
219 This->OnFolderChange++;
221 if(
This->set_filename)
224 ok(dlg_hwnd !=
NULL,
"Got NULL.\n");
226 hr = IFileDialog_SetFileName(
pfd,
This->set_filename);
229 if(!
This->set_filename_tried)
237 if(
This->events_test)
251 switch(
This->events_test)
267 ok(
FALSE,
"Should not happen (%d)\n",
This->events_test);
277 This->OnSelectionChange++;
287 This->OnShareViolation++;
294 This->OnTypeChange++;
305 ok(*pResponse ==
FDEOR_DEFAULT,
"overwrite response %u\n", *pResponse);
307 ok(!
This->OnFileOk,
"OnFileOk already called %lu times\n",
This->OnFileOk);
332 return &
This->IFileDialogEvents_iface;
338 IFileOpenDialog *pfod;
348 &IID_IFileOpenDialog, (
void**)&pfod);
351 win_skip(
"Could not instantiate the FileOpenDialog.\n");
356 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog, (
void**)&
pfd);
360 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&
punk);
363 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomizeAlt, (
void**)&unk2);
366 IUnknown_Release(
punk);
367 IUnknown_Release(unk2);
369 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileSaveDialog, (
void**)&pfsd);
373 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IServiceProvider, (
void**)&psp);
380 hr = IServiceProvider_QueryService(psp, &SID_SExplorerBrowserFrame, &IID_ICommDlgBrowser, (
void**)&
punk);
385 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IExplorerBrowser, (
void**)&peb);
388 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IShellBrowser, (
void**)&psb);
391 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_ICommDlgBrowser, (
void**)&
punk);
395 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &
IID_IUnknown, (
void**)&
punk);
402 IServiceProvider_Release(psp);
405 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogEvents, (
void**)&
punk);
409 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowser, (
void**)&
punk);
413 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowserEvents, (
void**)&
punk);
417 hr = IFileOpenDialog_QueryInterface(pfod, &IID_ICommDlgBrowser3, (
void**)&
punk);
421 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IShellBrowser, (
void**)&
punk);
431 hr = IOleWindow_ContextSensitiveHelp(
pow,
TRUE);
434 hr = IOleWindow_ContextSensitiveHelp(
pow,
FALSE);
440 IOleWindow_GetWindow(
pow,
NULL);
447 IOleWindow_Release(
pow);
450 ref = IFileOpenDialog_Release(pfod);
451 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
455 &IID_IFileSaveDialog, (
void**)&pfsd);
458 win_skip(
"Could not instantiate the FileSaveDialog.\n");
463 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog, (
void**)&
pfd);
467 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomize, (
void**)&
punk);
470 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomizeAlt, (
void**)&unk2);
473 IUnknown_Release(
punk);
474 IUnknown_Release(unk2);
476 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileOpenDialog, (
void**)&pfod);
480 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogEvents, (
void**)&
punk);
484 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowser, (
void**)&
punk);
488 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowserEvents, (
void**)&
punk);
492 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_ICommDlgBrowser3, (
void**)&
punk);
496 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IShellBrowser, (
void**)&
punk);
506 hr = IOleWindow_ContextSensitiveHelp(
pow,
TRUE);
509 hr = IOleWindow_ContextSensitiveHelp(
pow,
FALSE);
515 IOleWindow_GetWindow(
pow,
NULL);
522 IOleWindow_Release(
pow);
526 ref = IFileSaveDialog_Release(pfsd);
527 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
533 IFileOpenDialog *pfod;
536 FILEOPENDIALOGOPTIONS fdoptions;
539 IShellItemArray *psia;
546 const WCHAR txt[] = {
't',
'x',
't', 0};
548 const WCHAR fname1[] = {
'f',
'n',
'a',
'm',
'e',
'1', 0};
549 const WCHAR fspec1[] = {
'*',
'.',
't',
'x',
't',0};
550 const WCHAR fname2[] = {
'f',
'n',
'a',
'm',
'e',
'2', 0};
551 const WCHAR fspec2[] = {
'*',
'.',
'e',
'x',
'e',0};
553 const DWORD invalid_fos[] = {0x1, 0x10, 0x400, 0x80000, 0x400000, 0x800000, 0x1000000, 0x4000000, 0x8000000};
558 hr = pSHGetIDListFromObject((
IUnknown*)psfdesktop, &pidl);
561 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psidesktop);
564 IShellFolder_Release(psfdesktop);
567 skip(
"Failed to get ShellItem from DesktopFolder, skipping tests.\n");
574 &IID_IFileOpenDialog, (
void**)&pfod);
577 &IID_IFileSaveDialog, (
void**)&pfsd);
583 hr = IFileOpenDialog_ClearClientData(pfod);
585 hr = IFileSaveDialog_ClearClientData(pfsd);
590 hr = IFileOpenDialog_GetOptions(pfod,
NULL);
592 hr = IFileSaveDialog_GetOptions(pfsd,
NULL);
596 hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
598 ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR),
599 "Unexpected default options: 0x%08lx\n", fdoptions);
600 hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
602 ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
603 "Unexpected default options: 0x%08lx\n", fdoptions);
608 hr = IFileOpenDialog_SetOptions(pfod, invalid_fos[
i]);
610 hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
612 ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR),
"got %08lx\n", fdoptions);
614 hr = IFileSaveDialog_SetOptions(pfsd, invalid_fos[
i]);
616 hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
618 ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
619 "got %08lx\n", fdoptions);
623 hr = IFileOpenDialog_GetResult(pfod,
NULL);
625 hr = IFileSaveDialog_GetResult(pfsd,
NULL);
628 psi = (
void*)0xdeadbeef;
629 hr = IFileOpenDialog_GetResult(pfod, &psi);
631 ok(psi == (
void*)0xdeadbeef,
"got %p.\n", psi);
632 psi = (
void*)0xdeadbeef;
633 hr = IFileSaveDialog_GetResult(pfsd, &psi);
635 ok(psi == (
void*)0xdeadbeef,
"got %p.\n", psi);
640 hr = IFileOpenDialog_GetCurrentSelection(pfod,
NULL);
642 hr = IFileSaveDialog_GetCurrentSelection(pfsd,
NULL);
644 hr = IFileOpenDialog_GetCurrentSelection(pfod, &psi);
646 hr = IFileSaveDialog_GetCurrentSelection(pfsd, &psi);
651 hr = IFileOpenDialog_GetFileName(pfod,
NULL);
654 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
657 hr = IFileSaveDialog_GetFileName(pfsd,
NULL);
660 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
665 hr = IFileOpenDialog_GetFileTypeIndex(pfod,
NULL);
668 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
671 hr = IFileSaveDialog_GetFileTypeIndex(pfsd,
NULL);
674 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
679 hr = IFileOpenDialog_SetFileTypes(pfod, 0,
NULL);
681 hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
684 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
686 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 1);
688 hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
690 hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
692 hr = IFileOpenDialog_SetFileTypes(pfod, 0,
NULL);
694 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
696 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
699 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 100);
701 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
704 hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
706 hr = IFileOpenDialog_SetFileTypes(pfod, 1, &filterspec[1]);
709 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
711 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 1);
713 hr = IFileSaveDialog_SetFileTypes(pfsd, 2, filterspec);
715 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
719 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
721 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
724 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 100);
726 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
729 hr = IFileSaveDialog_SetFileTypes(pfsd, 1, filterspec);
731 hr = IFileSaveDialog_SetFileTypes(pfsd, 1, &filterspec[1]);
737 hr = IFileOpenDialog_SetFilter(pfod,
NULL);
739 hr = IFileSaveDialog_SetFilter(pfsd,
NULL);
744 hr = IFileOpenDialog_SetFolder(pfod,
NULL);
746 hr = IFileSaveDialog_SetFolder(pfsd,
NULL);
750 hr = IFileOpenDialog_SetDefaultExtension(pfod,
NULL);
752 hr = IFileOpenDialog_SetDefaultExtension(pfod, txt);
754 hr = IFileOpenDialog_SetDefaultExtension(pfod,
null);
757 hr = IFileSaveDialog_SetDefaultExtension(pfsd,
NULL);
759 hr = IFileSaveDialog_SetDefaultExtension(pfsd, txt);
761 hr = IFileSaveDialog_SetDefaultExtension(pfsd,
null);
765 hr = IFileOpenDialog_SetDefaultFolder(pfod,
NULL);
767 hr = IFileSaveDialog_SetDefaultFolder(pfsd,
NULL);
770 hr = IFileOpenDialog_SetDefaultFolder(pfod, psidesktop);
772 hr = IFileSaveDialog_SetDefaultFolder(pfsd, psidesktop);
778 IFileOpenDialog_SetDefaultFolder(pfod, (
void*)0x1234);
779 IFileSaveDialog_SetDefaultFolder(pfsd, (
void*)0x1234);
783 hr = IFileOpenDialog_GetFolder(pfod,
NULL);
786 hr = IFileOpenDialog_GetFolder(pfod, &psi_original);
790 hr = IFileOpenDialog_SetFolder(pfod, psidesktop);
792 hr = IFileOpenDialog_SetFolder(pfod, psi_original);
794 IShellItem_Release(psi_original);
797 hr = IFileSaveDialog_GetFolder(pfsd, &psi_original);
801 hr = IFileSaveDialog_SetFolder(pfsd, psidesktop);
803 hr = IFileSaveDialog_SetFolder(pfsd, psi_original);
805 IShellItem_Release(psi_original);
812 IFileOpenDialog_AddPlace(pfod,
NULL, 0);
813 IFileSaveDialog_AddPlace(pfsd,
NULL, 0);
816 hr = IFileOpenDialog_AddPlace(pfod, psidesktop,
FDAP_TOP + 1);
818 hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_BOTTOM);
820 hr = IFileOpenDialog_AddPlace(pfod, psidesktop,
FDAP_TOP);
823 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop,
FDAP_TOP + 1);
825 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_BOTTOM);
827 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop,
FDAP_TOP);
831 hr = IFileOpenDialog_SetFileName(pfod,
NULL);
833 hr = IFileOpenDialog_SetFileName(pfod,
null);
837 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
842 hr = IFileOpenDialog_SetFileName(pfod,
NULL);
846 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
850 hr = IFileOpenDialog_SetFileName(pfod, txt);
852 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
857 hr = IFileSaveDialog_SetFileName(pfsd,
NULL);
859 hr = IFileSaveDialog_SetFileName(pfsd,
null);
861 hr = IFileSaveDialog_SetFileName(pfsd, txt);
863 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
869 hr = IFileOpenDialog_SetFileNameLabel(pfod,
NULL);
871 hr = IFileOpenDialog_SetFileNameLabel(pfod,
null);
873 hr = IFileOpenDialog_SetFileNameLabel(pfod, txt);
876 hr = IFileSaveDialog_SetFileNameLabel(pfsd,
NULL);
878 hr = IFileSaveDialog_SetFileNameLabel(pfsd,
null);
880 hr = IFileSaveDialog_SetFileNameLabel(pfsd, txt);
884 hr = IFileOpenDialog_Close(pfod,
S_FALSE);
886 hr = IFileSaveDialog_Close(pfsd,
S_FALSE);
890 hr = IFileOpenDialog_SetOkButtonLabel(pfod,
NULL);
892 hr = IFileOpenDialog_SetOkButtonLabel(pfod,
null);
894 hr = IFileOpenDialog_SetOkButtonLabel(pfod, txt);
896 hr = IFileSaveDialog_SetOkButtonLabel(pfsd,
NULL);
898 hr = IFileSaveDialog_SetOkButtonLabel(pfsd,
null);
900 hr = IFileSaveDialog_SetOkButtonLabel(pfsd, txt);
904 hr = IFileOpenDialog_SetTitle(pfod,
NULL);
906 hr = IFileOpenDialog_SetTitle(pfod,
null);
908 hr = IFileOpenDialog_SetTitle(pfod, txt);
910 hr = IFileSaveDialog_SetTitle(pfsd,
NULL);
912 hr = IFileSaveDialog_SetTitle(pfsd,
null);
914 hr = IFileSaveDialog_SetTitle(pfsd, txt);
923 IFileOpenDialog_GetResults(pfod,
NULL);
925 psia = (
void*)0xdeadbeef;
926 hr = IFileOpenDialog_GetResults(pfod, &psia);
928 ok(psia ==
NULL,
"got %p.\n", psia);
934 hr = IFileOpenDialog_GetSelectedItems(pfod,
NULL);
936 psia = (
void*)0xdeadbeef;
937 hr = IFileOpenDialog_GetSelectedItems(pfod, &psia);
939 ok(psia == (
void*)0xdeadbeef,
"got %p.\n", psia);
949 IFileSaveDialog_ApplyProperties(pfsd, psidesktop,
NULL,
NULL,
NULL);
953 hr = IFileSaveDialog_GetProperties(pfsd,
NULL);
955 pps = (
void*)0xdeadbeef;
956 hr = IFileSaveDialog_GetProperties(pfsd, &pps);
958 ok(pps == (
void*)0xdeadbeef,
"got %p\n", pps);
964 hr = IFileSaveDialog_SetProperties(pfsd,
NULL);
971 hr = IFileSaveDialog_SetCollectedProperties(pfsd,
NULL,
TRUE);
973 hr = IFileSaveDialog_SetCollectedProperties(pfsd,
NULL,
FALSE);
980 hr = IFileSaveDialog_SetSaveAsItem(pfsd,
NULL);
982 hr = IFileSaveDialog_SetSaveAsItem(pfsd, psidesktop);
988 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog2, (
void**)&pfd2);
993 hr = IFileDialog2_SetOkButtonLabel(pfd2,
NULL);
995 hr = IFileDialog2_SetOkButtonLabel(pfd2,
null);
997 hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
1003 hr = IFileDialog2_SetNavigationRoot(pfd2,
NULL);
1005 hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
1009 IFileDialog2_Release(pfd2);
1012 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog2, (
void**)&pfd2);
1017 hr = IFileDialog2_SetOkButtonLabel(pfd2,
NULL);
1019 hr = IFileDialog2_SetOkButtonLabel(pfd2,
null);
1021 hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
1027 hr = IFileDialog2_SetNavigationRoot(pfd2,
NULL);
1029 hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
1033 IFileDialog2_Release(pfd2);
1037 IShellItem_Release(psidesktop);
1038 ref = IFileOpenDialog_Release(pfod);
1039 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
1040 ref = IFileSaveDialog_Release(pfsd);
1041 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
1057#define ensure_zero_events(impl) ensure_zero_events_(__FILE__, __LINE__, impl)
1075 hr = IFileDialog_Advise(
pfd, pfde,
NULL);
1080 ok(pfdeimpl->
ref == 1,
"got ref %ld\n", pfdeimpl->
ref);
1083 hr = IFileDialog_Unadvise(
pfd, 0);
1085 for(
i = 0;
i < 10;
i++) {
1090 ok(pfdeimpl->
ref == 10+1,
"got ref %ld\n", pfdeimpl->
ref);
1093 for(
i = 3;
i < 7;
i++) {
1097 ok(pfdeimpl->
ref == 6+1,
"got ref %ld\n", pfdeimpl->
ref);
1100 for(
i = 0;
i < 3;
i++) {
1104 ok(pfdeimpl->
ref == 3+1,
"got ref %ld\n", pfdeimpl->
ref);
1107 for(
i = 7;
i < 10;
i++) {
1111 ok(pfdeimpl->
ref == 1,
"got ref %ld\n", pfdeimpl->
ref);
1116 ok(pfdeimpl->
ref == 1,
"got ref %ld\n", pfdeimpl->
ref);
1122 ok(pfdeimpl->
ref == 1+1,
"got ref %ld\n", pfdeimpl->
ref);
1135 IFileDialogEvents_Release(pfde);
1144 trace(
"Testing FileOpenDialog (advise)\n");
1146 &IID_IFileDialog, (
void**)&
pfd);
1149 ref = IFileDialog_Release(
pfd);
1150 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
1152 trace(
"Testing FileSaveDialog (advise)\n");
1154 &IID_IFileDialog, (
void**)&
pfd);
1157 ref = IFileDialog_Release(
pfd);
1158 ok(!
ref,
"Got refcount %ld, should have been released.\n",
ref);
1164 const WCHAR filetype1[] = {
'f',
'n',
'a',
'm',
'e',
'1',0};
1165 const WCHAR filetype1_broken[] = {
'f',
'n',
'a',
'm',
'e',
'1',
' ',
'(',
'*',
'.',
't',
'x',
't',
')',0};
1168 ok(cb_filetype !=
NULL ||
broken(cb_filetype ==
NULL),
"Could not find combobox on first attempt\n");
1174 trace(
"Didn't find combobox on first attempt, trying broken string..\n");
1176 ok(
broken(cb_filetype !=
NULL),
"Failed to find combobox on second attempt\n");
1196 const WCHAR fname1[] = {
'f',
'n',
'a',
'm',
'e',
'1', 0};
1197 const WCHAR fspec1[] = {
'*',
'.',
't',
'x',
't',0};
1198 const WCHAR fname2[] = {
'f',
'n',
'a',
'm',
'e',
'2', 0};
1199 const WCHAR fspec2[] = {
'*',
'.',
'e',
'x',
'e',0};
1207 &IID_IFileDialog, (
void**)&
pfd);
1234 IFileDialogEvents_Release(pfde);
1235 ref = IFileDialog_Release(
pfd);
1243 &IID_IFileDialog, (
void**)&
pfd);
1253 hr = IFileDialog_SetFileTypes(
pfd, 2, filterspec);
1276 IFileDialogEvents_Release(pfde);
1277 ref = IFileDialog_Release(
pfd);
1285 &IID_IFileDialog, (
void**)&
pfd);
1295 hr = IFileDialog_SetFileTypes(
pfd, 2, filterspec);
1318 IFileDialogEvents_Release(pfde);
1319 ref = IFileDialog_Release(
pfd);
1345 &IID_IFileSaveDialog, (
void**)&pfsd);
1350 hr = IFileSaveDialog_SetFileTypes(pfsd, fs_count, filterspec);
1356 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, ft_index);
1362 hr = IFileSaveDialog_SetDefaultExtension(pfsd, defext);
1368 hr = IFileSaveDialog_SetFileName(pfsd, set_filename2);
1375 hr = IFileSaveDialog_Advise(pfsd, pfde, &
cookie);
1378 hr = IFileSaveDialog_Show(pfsd,
NULL);
1381 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
1386 hr = IFileSaveDialog_GetResult(pfsd, &psi);
1389 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1393 IShellItem_Release(psi);
1395 hr = IFileSaveDialog_Unadvise(pfsd,
cookie);
1398 ref = IFileSaveDialog_Release(pfsd);
1401 IFileDialogEvents_Release(pfde);
1403#define test_filename_savedlg(set_filename, set_filename2, defext, filterspec, fs_count, ft_index, exp_filename) \
1404 test_filename_savedlg_(set_filename, set_filename2, defext, filterspec, fs_count, ft_index, exp_filename, __FILE__, __LINE__)
1411 IFileOpenDialog *pfod;
1416 IShellItemArray *psia;
1422 &IID_IFileOpenDialog, (
void**)&pfod);
1427 hr = IFileOpenDialog_SetDefaultExtension(pfod, defext);
1433 hr = IFileOpenDialog_SetFileTypes(pfod, fs_count, filterspec);
1439 hr = IFileOpenDialog_SetFileTypeIndex(pfod, ft_index);
1445 hr = IFileOpenDialog_SetFileName(pfod, set_filename2);
1449 hr = IFileOpenDialog_SetFolder(pfod, psi_current);
1456 hr = IFileOpenDialog_Advise(pfod, pfde, &
cookie);
1459 hr = IFileOpenDialog_Show(pfod,
NULL);
1461 "Show failed: Got 0x%08lx\n",
hr);
1464 hr = IFileOpenDialog_GetResult(pfod, &psi);
1467 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1471 IShellItem_Release(psi);
1473 hr = IFileOpenDialog_GetResults(pfod, &psia);
1475 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
1478 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1483 IShellItem_Release(psi);
1484 IShellItemArray_Release(psia);
1488 hr = IFileOpenDialog_GetResult(pfod, &psi);
1491 hr = IFileOpenDialog_GetResults(pfod, &psia);
1495 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
1501 hr = IFileOpenDialog_Unadvise(pfod,
cookie);
1504 ref = IFileOpenDialog_Release(pfod);
1507 IFileDialogEvents_Release(pfde);
1509#define test_filename_opendlg(set_filename, set_filename2, psi, defext, filterspec, fs_count, ft_index, exp_filename) \
1510 test_filename_opendlg_(set_filename, set_filename2, psi, defext, filterspec, fs_count, ft_index, exp_filename, __FILE__, __LINE__)
1518 static const WCHAR filename_noextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0};
1519 static const WCHAR filename_dotextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',0};
1520 static const WCHAR filename_dotanddefW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'.',
'w',
't',
'e',0};
1521 static const WCHAR filename_defextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'e',0};
1522 static const WCHAR filename_mixedcaseW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'W',
'T',
'E',0};
1523 static const WCHAR filename_ext1W[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'1',0};
1524 static const WCHAR filename_ext2W[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'2',0};
1525 static const WCHAR filename_ext1anddefW[] =
1526 {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'1',
'.',
'w',
't',
'e',0};
1527 static const WCHAR defextW[] = {
'w',
't',
'e',0};
1528 static const WCHAR desc1[] = {
'd',
'e',
's',
'c',
'r',
'i',
'p',
't',
'i',
'o',
'n',
'1',0};
1529 static const WCHAR desc2[] = {
'd',
'e',
's',
'c',
'r',
'i',
'p',
't',
'i',
'o',
'n',
'2',0};
1530 static const WCHAR descdef[] = {
'd',
'e',
'f',
'a',
'u',
'l',
't',
' ',
'd',
'e',
's',
'c',0};
1531 static const WCHAR ext1[] = {
'*',
'.',
'w',
't',
'1',0};
1532 static const WCHAR ext2[] = {
'*',
'.',
'w',
't',
'2',0};
1533 static const WCHAR extdef[] = {
'*',
'.',
'w',
't',
'e',0};
1534 static const WCHAR complexext[] = {
'*',
'.',
'w',
't',
'2',
';',
'*',
'.',
'w',
't',
'1',0};
1536 static const WCHAR long_ext[] =
L"*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;*.wt2;";
1539 { desc1,
ext1 }, { desc2,
ext2 }, { descdef, extdef }
1542 { desc1, complexext }
1574 ok(!!pSHCreateItemFromParsingName,
"SHCreateItemFromParsingName is missing.\n");
1575 hr = pSHCreateItemFromParsingName(
buf,
NULL, &IID_IShellItem, (
void**)&psi_current);
1603 IShellItem_Release(psi_current);
1610static const WCHAR menuW[] = {
'm',
'e',
'n',
'u',
'_',
'i',
't',
'e',
'm',0};
1611static const WCHAR pushbutton1W[] = {
'p',
'u',
's',
'h',
'b',
'u',
't',
't',
'o',
'n',
'_',
'i',
't',
'e',
'm',0};
1612static const WCHAR pushbutton2W[] = {
'p',
'u',
's',
'h',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1613static const WCHAR comboboxitem1W[] = {
'c',
'o',
'm',
'b',
'o',
'b',
'o',
'x',
'1',
'_',
'i',
't',
'e',
'm',0};
1614static const WCHAR comboboxitem2W[] = {
'c',
'o',
'm',
'b',
'o',
'b',
'o',
'x',
'2',
'_',
'i',
't',
'e',
'm',0};
1615static const WCHAR radiobutton1W[] = {
'r',
'a',
'd',
'i',
'o',
'b',
'u',
't',
't',
'o',
'n',
'1',
'_',
'i',
't',
'e',
'm',0};
1616static const WCHAR radiobutton2W[] = {
'r',
'a',
'd',
'i',
'o',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1617static const WCHAR checkbutton1W[] = {
'c',
'h',
'e',
'c',
'k',
'b',
'u',
't',
't',
'o',
'n',
'1',
'_',
'i',
't',
'e',
'm',0};
1618static const WCHAR checkbutton2W[] = {
'c',
'h',
'e',
'c',
'k',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1619static const WCHAR editbox1W[] = {
'e',
'd',
'i',
't',
'b',
'o',
'x',
'W',
'1',
'_',
'i',
't',
'e',
'm',0};
1620static const WCHAR editbox2W[] = {
'e',
'd',
'i',
't',
'b',
'o',
'x',
'W',
'2',
'_',
'i',
't',
'e',
'm',0};
1621static const WCHAR textW[] = {
't',
'e',
'x',
't',
'_',
'i',
't',
'e',
'm',0};
1622static const WCHAR text2W[] = {
't',
'e',
'x',
't',
'2',
'_',
'i',
't',
'e',
'm',0};
1623static const WCHAR separatorW[] = {
's',
'e',
'p',
'a',
'r',
'a',
't',
'o',
'r',
'_',
'i',
't',
'e',
'm',0};
1624static const WCHAR visualgroup1W[] = {
'v',
'i',
's',
'u',
'a',
'l',
'g',
'r',
'o',
'u',
'p',
'1',0};
1625static const WCHAR visualgroup2W[] = {
'v',
'i',
's',
'u',
'a',
'l',
'g',
'r',
'o',
'u',
'p',
'2',0};
1627static const WCHAR floatnotifysinkW[] = {
'F',
'l',
'o',
'a',
't',
'N',
'o',
't',
'i',
'f',
'y',
'S',
'i',
'n',
'k',0};
1628static const WCHAR RadioButtonListW[] = {
'R',
'a',
'd',
'i',
'o',
'B',
'u',
't',
't',
'o',
'n',
'L',
'i',
's',
't',0};
1639 ok(dlg_hwnd !=
NULL,
"Got NULL.\n");
1692 IFileDialogCustomize *pfdc;
1696 CDCONTROLSTATEF cdstate;
1700 UINT id_vgroup1, id_text, id_editbox1;
1705 &IID_IFileDialog, (
void**)&pfod);
1708 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
1712 skip(
"Skipping IFileDialogCustomize tests.\n");
1713 IFileDialog_Release(pfod);
1725 hr = IOleWindow_GetWindow(
pow, &dlg_hwnd);
1727 ok(dlg_hwnd ==
NULL,
"NULL\n");
1728 IOleWindow_Release(
pow);
1730 cdstate = 0xdeadbeef;
1731 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1735 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1738 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1739 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1741 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i);
1743 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++
i);
1746 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i);
1748 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i+1);
1751 cdstate = 0xdeadbeef;
1752 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1754 ok(cdstate == 0xdeadbeef,
"got 0x%08x.\n", cdstate);
1756 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1758 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1761 cdstate = 0xdeadbeef;
1762 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1765 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
1767 cdstate = 0xdeadbeef;
1768 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1770 ok(!cdstate,
"got 0x%08x.\n", cdstate);
1773 cdstate = 0xdeadbeef;
1774 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1778 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1781 hr = IFileDialogCustomize_AddMenu(pfdc,
i,
menuW);
1783 hr = IFileDialogCustomize_AddMenu(pfdc, ++
i,
label);
1786 cdstate = 0xdeadbeef;
1787 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1791 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1793 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1796 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1797 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1804 cdstate = 0xdeadbeef;
1805 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1809 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1812 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1813 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1815 hr = IFileDialogCustomize_AddComboBox(pfdc,
i);
1817 hr = IFileDialogCustomize_AddComboBox(pfdc, ++
i);
1820 cdstate = 0xdeadbeef;
1821 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1825 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1827 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1830 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1831 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1833 hr = IFileDialogCustomize_AddRadioButtonList(pfdc,
i);
1835 hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++
i);
1838 cdstate = 0xdeadbeef;
1839 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1849 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1851 hr = IFileDialogCustomize_AddCheckButton(pfdc,
i,
label,
TRUE);
1856 cdstate = 0xdeadbeef;
1857 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1861 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1865 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1870 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1872 ok(checked,
"checkbox not checked.\n");
1874 hr = IFileDialogCustomize_SetCheckButtonState(pfdc,
i,
FALSE);
1877 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1879 ok(!checked,
"checkbox checked.\n");
1881 hr = IFileDialogCustomize_SetCheckButtonState(pfdc,
i,
TRUE);
1884 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1886 ok(checked,
"checkbox not checked.\n");
1889 hr = IFileDialogCustomize_AddEditBox(pfdc,
i,
label);
1891 hr = IFileDialogCustomize_AddEditBox(pfdc, ++
i,
editbox1W);
1894 cdstate = 0xdeadbeef;
1895 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1899 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1903 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
editbox2W);
1904 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1906 hr = IFileDialogCustomize_GetEditBoxText(pfdc,
i, &tmpstr);
1914 hr = IFileDialogCustomize_SetEditBoxText(pfdc,
i,
label2);
1917 hr = IFileDialogCustomize_GetEditBoxText(pfdc,
i, &tmpstr);
1925 hr = IFileDialogCustomize_AddSeparator(pfdc,
i);
1927 hr = IFileDialogCustomize_AddSeparator(pfdc, ++
i);
1930 cdstate = 0xdeadbeef;
1931 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1935 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1938 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
separatorW);
1939 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1941 hr = IFileDialogCustomize_AddText(pfdc,
i,
label);
1943 hr = IFileDialogCustomize_AddText(pfdc, ++
i,
textW);
1946 cdstate = 0xdeadbeef;
1947 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1951 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1954 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
text2W);
1955 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1957 hr = IFileDialogCustomize_StartVisualGroup(pfdc,
i,
label);
1962 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1966 ok(
hr ==
S_OK,
"got 0x%08lx (control: %d).\n",
hr,
i);
1968 cdstate = 0xdeadbeef;
1969 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1973 hr = IFileDialogCustomize_StartVisualGroup(pfdc, ++
i,
label);
1975 hr = IFileDialogCustomize_EndVisualGroup(pfdc);
1979 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1981 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1983 cdstate = 0xdeadbeef;
1984 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1986 ok(cdstate == 0xdeadbeef,
"got 0x%08x.\n", cdstate);
1991 hr = IFileDialog_Advise(pfod, pfde, &
cookie);
1994 hr = IFileDialog_Show(pfod,
NULL);
1997 hr = IFileDialog_Unadvise(pfod,
cookie);
2000 IFileDialogEvents_Release(pfde);
2001 IFileDialogCustomize_Release(pfdc);
2002 ref = IFileDialog_Release(pfod);
2003 ok(!
ref,
"Refcount not zero (%ld).\n",
ref);
2007 &IID_IFileDialog, (
void**)&pfod);
2010 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
2014 hr = IFileDialogCustomize_AddMenu(pfdc, ++
i,
label);
2021 for(
j = 0;
j < 10;
j++)
2023 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2027 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2030 cdstate = 0xdeadbeef;
2031 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2034 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2036 cdstate = 0xdeadbeef;
2037 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2039 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2042 cdstate = 0xdeadbeef;
2043 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2047 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2050 for(
j = 0;
j < 10;
j++)
2052 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2056 hr = IFileDialogCustomize_AddPushButton(pfdc, ++
i,
label);
2058 hr = IFileDialogCustomize_AddComboBox(pfdc, ++
i);
2065 for(
j = 0;
j < 10;
j++)
2067 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2071 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2075 cdstate = 0xdeadbeef;
2076 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2079 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2081 cdstate = 0xdeadbeef;
2082 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2084 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2087 cdstate = 0xdeadbeef;
2088 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2092 for(
j = 0;
j < 10;
j++)
2094 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2096 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2101 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2104 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2107 for(
j = 0;
j < 10;
j++)
2109 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2114 hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++
i);
2121 for(
j = 0;
j < 10;
j++)
2123 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2127 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2131 cdstate = 0xdeadbeef;
2132 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2135 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2137 cdstate = 0xdeadbeef;
2138 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2140 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2143 cdstate = 0xdeadbeef;
2144 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2148 for(
j = 0;
j < 10;
j++)
2150 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2152 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2157 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2160 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2163 for(
j = 0;
j < 10;
j++)
2165 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2169 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++
i);
2176 for(
j = 0;
j < 10;
j++)
2178 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2182 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2186 cdstate = 0xdeadbeef;
2187 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2190 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2192 cdstate = 0xdeadbeef;
2193 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2195 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2198 cdstate = 0xdeadbeef;
2199 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2202 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i, 0);
2205 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2208 for(
j = 0;
j < 10;
j++)
2210 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2215 IFileDialogCustomize_Release(pfdc);
2216 ref = IFileDialog_Release(pfod);
2217 ok(!
ref,
"Refcount not zero (%ld).\n",
ref);
2222 &IID_IFileDialog, (
void**)&pfod);
2225 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
2230 hr = IFileDialogCustomize_StartVisualGroup(pfdc, id_vgroup1,
visualgroup1W);
2233 cdstate = 0xdeadbeef;
2234 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2239 hr = IFileDialogCustomize_AddText(pfdc, id_text,
label);
2242 cdstate = 0xdeadbeef;
2243 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2248 hr = IFileDialogCustomize_AddEditBox(pfdc, id_editbox1,
editbox1W);
2251 cdstate = 0xdeadbeef;
2252 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2258 hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1,
CDCS_VISIBLE);
2261 cdstate = 0xdeadbeef;
2262 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2265 cdstate = 0xdeadbeef;
2267 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2271 cdstate = 0xdeadbeef;
2272 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2277 hr = IFileDialogCustomize_SetControlState(pfdc, id_text,
CDCS_VISIBLE);
2280 cdstate = 0xdeadbeef;
2281 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2284 cdstate = 0xdeadbeef;
2286 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2290 cdstate = 0xdeadbeef;
2291 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2296 hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1, CDCS_INACTIVE);
2299 cdstate = 0xdeadbeef;
2300 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2302 ok(cdstate == CDCS_INACTIVE,
"got 0x%08x.\n", cdstate);
2304 cdstate = 0xdeadbeef;
2305 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2309 cdstate = 0xdeadbeef;
2310 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2318 cdstate = 0xdeadbeef;
2319 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2323 cdstate = 0xdeadbeef;
2324 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2328 cdstate = 0xdeadbeef;
2329 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2333 hr = IFileDialogCustomize_MakeProminent(pfdc, id_vgroup1);
2336 IFileDialogCustomize_Release(pfdc);
2337 ref = IFileDialog_Release(pfod);
2338 ok(!
ref,
"Refcount not zero (%ld).\n",
ref);
2347 &IID_IFileDialog, (
void**)&
fd);
2353 hr = IFileDialog_SetClientGuid(
fd,
NULL);
2362 IFileDialog_Release(
fd);
2367 static const WCHAR filename_winetest[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'o',
'v',
'w',0};
2378 ok(!!pSHCreateItemFromParsingName,
"SHCreateItemFromParsingName is missing.\n");
2379 hr = pSHCreateItemFromParsingName(
buf,
NULL, &IID_IShellItem, (
void**)&psi_current);
2386 &IID_IFileDialog, (
void**)&
fd);
2389 hr = IFileDialog_SetOptions(
fd, FOS_OVERWRITEPROMPT | FOS_NOCHANGEDIR);
2392 hr = IFileDialog_SetFolder(
fd, psi_current);
2399 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08lx\n",
hr);
2402 ok(
hr ==
S_OK,
"Show failed: Got 0x%08lx\n",
hr);
2408 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08lx\n",
hr);
2415 IFileDialog_Release(
fd);
2417 IFileDialogEvents_Release(pfde);
2421 &IID_IFileDialog, (
void**)&
fd);
2424 hr = IFileDialog_SetOptions(
fd, FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR);
2427 hr = IFileDialog_SetFolder(
fd, psi_current);
2434 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08lx\n",
hr);
2437 ok(
hr ==
S_OK,
"Show failed: Got 0x%08lx\n",
hr);
2443 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08lx\n",
hr);
2450 IFileDialog_Release(
fd);
2452 IFileDialogEvents_Release(pfde);
2456 &IID_IFileDialog, (
void**)&
fd);
2459 hr = IFileDialog_SetFolder(
fd, psi_current);
2466 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08lx\n",
hr);
2469 ok(
hr ==
S_OK,
"Show failed: Got 0x%08lx\n",
hr);
2475 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08lx\n",
hr);
2482 IFileDialog_Release(
fd);
2484 IFileDialogEvents_Release(pfde);
2490 &IID_IFileDialog, (
void**)&
fd);
2493 hr = IFileDialog_SetFolder(
fd, psi_current);
2500 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08lx\n",
hr);
2503 ok(
hr ==
S_OK,
"Show failed: Got 0x%08lx\n",
hr);
2509 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08lx\n",
hr);
2516 IFileDialog_Release(
fd);
2518 IFileDialogEvents_Release(pfde);
2520 IShellItem_Release(psi_current);
2526 IFileDialogCustomize *pfdc;
2530 &IID_IFileDialog, (
void**)&pfod);
2533 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
2537 skip(
"Skipping IFileDialogCustomize tests.\n");
2538 IFileDialog_Release(pfod);
2543 hr = IFileDialogCustomize_AddComboBox(pfdc,
i);
2546 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2549 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i, 1000);
2552 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i, 0);
2555 IFileDialogCustomize_Release(pfdc);
2556 IFileDialog_Release(pfod);
2568 &IID_IFileDialog, (
void**)&
pfd);
2584 IFileDialogEvents_Release(pfde);
2585 IFileDialog_Release(
pfd);
2595 DWORD result_tmpdir;
2596 BOOL result_set_dir;
2601 ok(result_tmpdir != 0,
"got %ld\n", result_tmpdir);
2603 ok(result_set_dir,
"failed to set dir\n");
2616 skip(
"Skipping all Item Dialog tests.\n");
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
EXTERN_C HRESULT WINAPI SHCreateItemFromParsingName(_In_ PCWSTR pszPath, _In_opt_ IBindCtx *pbc, _In_ REFIID riid, _Out_ void **ppv)
HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi)
#define InterlockedIncrement
#define InterlockedDecrement
static char selected[MAX_PATH+1]
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
void WINAPI CoTaskMemFree(void *ptr)
#define GetCurrentDirectoryW(x, y)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
double pow(double x, double y)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static NTSTATUS *static PWSTR CURDIR *static HMODULE hmod
static const WCHAR editbox1W[]
#define IDT_CHANGEFILETYPE
static void filedialog_change_filetype(IFileDialog *pfd, HWND dlg_hwnd)
static void test_overwrite(void)
static const WCHAR text2W[]
static BOOL CALLBACK find_window_callback(HWND hwnd, LPARAM lparam)
static void test_filename_savedlg_(LPCWSTR set_filename, LPCWSTR set_filename2, LPCWSTR defext, const COMDLG_FILTERSPEC *filterspec, UINT fs_count, UINT ft_index, LPCWSTR exp_filename, const char *file, int line)
static HWND get_hwnd_from_ifiledialog(IFileDialog *pfd)
static const WCHAR radiobutton1W[]
static const WCHAR floatnotifysinkW[]
static ULONG WINAPI IFileDialogEvents_fnAddRef(IFileDialogEvents *iface)
static void ensure_zero_events_(const char *file, int line, IFileDialogEventsImpl *impl)
static LRESULT CALLBACK test_customize_dlgproc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
static HRESULT WINAPI IFileDialogEvents_fnOnSelectionChange(IFileDialogEvents *iface, IFileDialog *pfd)
static HRESULT WINAPI IFileDialogEvents_fnOnOverwrite(IFileDialogEvents *iface, IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse)
static void test_double_show(void)
static const WCHAR label[]
static const WCHAR visualgroup2W[]
static HRESULT WINAPI IFileDialogEvents_fnOnFolderChanging(IFileDialogEvents *iface, IFileDialog *pfd, IShellItem *psiFolder)
static ULONG WINAPI IFileDialogEvents_fnRelease(IFileDialogEvents *iface)
static const WCHAR pushbutton2W[]
#define test_filename_opendlg(set_filename, set_filename2, psi, defext, filterspec, fs_count, ft_index, exp_filename)
static void test_customize_onfolderchange(IFileDialog *pfd)
static HRESULT WINAPI IFileDialogEvents_fnOnTypeChange(IFileDialogEvents *iface, IFileDialog *pfd)
static const WCHAR RadioButtonListW[]
static const WCHAR comboboxitem2W[]
static IShellFolder LPCITEMIDLIST
#define ensure_zero_events(impl)
static IFileDialogEvents * IFileDialogEvents_Constructor(void)
static void test_filename(void)
static const WCHAR separatorW[]
static HRESULT WINAPI IFileDialogEvents_fnQueryInterface(IFileDialogEvents *iface, REFIID riid, void **ppv)
static void test_advise_helper(IFileDialog *pfd)
static IFileDialogEventsImpl * impl_from_IFileDialogEvents(IFileDialogEvents *iface)
static HRESULT WINAPI IFileDialogEvents_fnOnShareViolation(IFileDialogEvents *iface, IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse)
static const WCHAR textW[]
static const WCHAR checkbutton2W[]
static void touch_file(LPCWSTR filename)
static IShellFolder IShellItem **static PIDLIST_ABSOLUTE *static IBindCtx void **static void init_function_pointers(void)
static const WCHAR editbox2W[]
static const WCHAR comboboxitem1W[]
static HRESULT WINAPI IFileDialogEvents_fnOnFileOk(IFileDialogEvents *iface, IFileDialog *pfd)
#define test_filename_savedlg(set_filename, set_filename2, defext, filterspec, fs_count, ft_index, exp_filename)
static BOOL test_instantiation(void)
static void test_customize_remove_from_empty_combobox(void)
static const WCHAR pushbutton1W[]
static void test_customize(void)
static void test_events(void)
static void test_filename_opendlg_(LPCWSTR set_filename, LPCWSTR set_filename2, IShellItem *psi_current, LPCWSTR defext, const COMDLG_FILTERSPEC *filterspec, UINT fs_count, UINT ft_index, LPCWSTR exp_filename, const char *file, int line)
static const WCHAR menuW[]
static HRESULT WINAPI IFileDialogEvents_fnOnFolderChange(IFileDialogEvents *iface, IFileDialog *pfd)
static const IFileDialogEventsVtbl vt_IFileDialogEvents
static const WCHAR label2[]
static const WCHAR checkbutton1W[]
static const WCHAR visualgroup1W[]
static void test_advise(void)
static const WCHAR radiobutton2W[]
static void test_persistent_state(void)
static void test_basics(void)
const GUID IID_IOleWindow
void WINAPI ILFree(LPITEMIDLIST pidl)
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define GetWindowLongPtrW
HANDLE WINAPI GetPropA(_In_ HWND, _In_ LPCSTR)
BOOL WINAPI SetPropA(_In_ HWND, _In_ LPCSTR, _In_opt_ HANDLE)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetParent(_In_ HWND)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static char tmpdir[MAX_PATH]
FDE_SHAREVIOLATION_RESPONSE
ITEMIDLIST UNALIGNED * LPITEMIDLIST
static PIXELFORMATDESCRIPTOR pfd
FileDialogEventsTest events_test
IFileDialogEvents IFileDialogEvents_iface
#define CONTAINING_RECORD(address, type, field)
static HWND find_window()
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)