28#define IDT_CHANGEFILETYPE 500
29#define IDT_CLOSEDIALOG 501
46#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hmod, #f))
54DEFINE_GUID(IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0,0xAA, 0x2A,0x37,0x49,0x4E,0x60,0x6F);
101 hr = IOleWindow_GetWindow(
pow, &dlg_hwnd);
104 IOleWindow_Release(
pow);
135 ok(0,
"Unexpectedly called.\n");
168 This->OnFolderChanging++;
208 This->OnFolderChange++;
210 if(
This->set_filename)
213 ok(dlg_hwnd !=
NULL,
"Got NULL.\n");
215 hr = IFileDialog_SetFileName(
pfd,
This->set_filename);
218 if(!
This->set_filename_tried)
226 if(
This->events_test)
240 switch(
This->events_test)
253 ok(
FALSE,
"Should not happen (%d)\n",
This->events_test);
263 This->OnSelectionChange++;
273 This->OnShareViolation++;
280 This->OnTypeChange++;
291 ok(*pResponse ==
FDEOR_DEFAULT,
"overwrite response %u\n", *pResponse);
293 ok(!
This->OnFileOk,
"OnFileOk already called %u times\n",
This->OnFileOk);
318 return &
This->IFileDialogEvents_iface;
324 IFileOpenDialog *pfod;
334 &IID_IFileOpenDialog, (
void**)&pfod);
337 win_skip(
"Could not instantiate the FileOpenDialog.\n");
342 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog, (
void**)&
pfd);
346 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&punk);
349 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogCustomizeAlt, (
void**)&unk2);
351 ok(punk == unk2,
"got %p, %p\n", punk, unk2);
352 IUnknown_Release(punk);
353 IUnknown_Release(unk2);
355 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileSaveDialog, (
void**)&pfsd);
359 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IServiceProvider, (
void**)&psp);
366 hr = IServiceProvider_QueryService(psp, &SID_SExplorerBrowserFrame, &IID_ICommDlgBrowser, (
void**)&punk);
371 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IExplorerBrowser, (
void**)&peb);
374 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_IShellBrowser, (
void**)&psb);
377 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &IID_ICommDlgBrowser, (
void**)&punk);
381 hr = IServiceProvider_QueryService(psp, &SID_STopLevelBrowser, &
IID_IUnknown, (
void**)&punk);
388 IServiceProvider_Release(psp);
391 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialogEvents, (
void**)&punk);
395 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowser, (
void**)&punk);
399 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IExplorerBrowserEvents, (
void**)&punk);
403 hr = IFileOpenDialog_QueryInterface(pfod, &IID_ICommDlgBrowser3, (
void**)&punk);
407 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IShellBrowser, (
void**)&punk);
417 hr = IOleWindow_ContextSensitiveHelp(
pow,
TRUE);
420 hr = IOleWindow_ContextSensitiveHelp(
pow,
FALSE);
426 IOleWindow_GetWindow(
pow,
NULL);
433 IOleWindow_Release(
pow);
436 ref = IFileOpenDialog_Release(pfod);
437 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
441 &IID_IFileSaveDialog, (
void**)&pfsd);
444 skip(
"Could not instantiate the FileSaveDialog.\n");
449 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog, (
void**)&
pfd);
453 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomize, (
void**)&punk);
456 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogCustomizeAlt, (
void**)&unk2);
458 ok(punk == unk2,
"got %p, %p\n", punk, unk2);
459 IUnknown_Release(punk);
460 IUnknown_Release(unk2);
462 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileOpenDialog, (
void**)&pfod);
466 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialogEvents, (
void**)&punk);
470 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowser, (
void**)&punk);
474 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IExplorerBrowserEvents, (
void**)&punk);
478 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_ICommDlgBrowser3, (
void**)&punk);
482 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IShellBrowser, (
void**)&punk);
492 hr = IOleWindow_ContextSensitiveHelp(
pow,
TRUE);
495 hr = IOleWindow_ContextSensitiveHelp(
pow,
FALSE);
501 IOleWindow_GetWindow(
pow,
NULL);
508 IOleWindow_Release(
pow);
512 ref = IFileSaveDialog_Release(pfsd);
513 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
519 IFileOpenDialog *pfod;
522 FILEOPENDIALOGOPTIONS fdoptions;
525 IShellItemArray *psia;
532 const WCHAR txt[] = {
't',
'x',
't', 0};
534 const WCHAR fname1[] = {
'f',
'n',
'a',
'm',
'e',
'1', 0};
535 const WCHAR fspec1[] = {
'*',
'.',
't',
'x',
't',0};
536 const WCHAR fname2[] = {
'f',
'n',
'a',
'm',
'e',
'2', 0};
537 const WCHAR fspec2[] = {
'*',
'.',
'e',
'x',
'e',0};
539 const DWORD invalid_fos[] = {0x1, 0x10, 0x400, 0x80000, 0x400000, 0x800000, 0x1000000, 0x4000000, 0x8000000};
544 hr = pSHGetIDListFromObject((
IUnknown*)psfdesktop, &pidl);
547 hr = pSHCreateShellItem(
NULL,
NULL, pidl, &psidesktop);
550 IShellFolder_Release(psfdesktop);
553 skip(
"Failed to get ShellItem from DesktopFolder, skipping tests.\n");
560 &IID_IFileOpenDialog, (
void**)&pfod);
563 &IID_IFileSaveDialog, (
void**)&pfsd);
569 hr = IFileOpenDialog_ClearClientData(pfod);
571 hr = IFileSaveDialog_ClearClientData(pfsd);
576 hr = IFileOpenDialog_GetOptions(pfod,
NULL);
578 hr = IFileSaveDialog_GetOptions(pfsd,
NULL);
582 hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
584 ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR),
585 "Unexpected default options: 0x%08x\n", fdoptions);
586 hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
588 ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
589 "Unexpected default options: 0x%08x\n", fdoptions);
594 hr = IFileOpenDialog_SetOptions(pfod, invalid_fos[
i]);
596 hr = IFileOpenDialog_GetOptions(pfod, &fdoptions);
598 ok(fdoptions == (FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR),
"got %08x\n", fdoptions);
600 hr = IFileSaveDialog_SetOptions(pfsd, invalid_fos[
i]);
602 hr = IFileSaveDialog_GetOptions(pfsd, &fdoptions);
604 ok(fdoptions == (FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR),
605 "got %08x\n", fdoptions);
609 hr = IFileOpenDialog_GetResult(pfod,
NULL);
611 hr = IFileSaveDialog_GetResult(pfsd,
NULL);
614 psi = (
void*)0xdeadbeef;
615 hr = IFileOpenDialog_GetResult(pfod, &psi);
617 ok(psi == (
void*)0xdeadbeef,
"got %p.\n", psi);
618 psi = (
void*)0xdeadbeef;
619 hr = IFileSaveDialog_GetResult(pfsd, &psi);
621 ok(psi == (
void*)0xdeadbeef,
"got %p.\n", psi);
626 hr = IFileOpenDialog_GetCurrentSelection(pfod,
NULL);
628 hr = IFileSaveDialog_GetCurrentSelection(pfsd,
NULL);
630 hr = IFileOpenDialog_GetCurrentSelection(pfod, &psi);
632 hr = IFileSaveDialog_GetCurrentSelection(pfsd, &psi);
637 hr = IFileOpenDialog_GetFileName(pfod,
NULL);
640 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
643 hr = IFileSaveDialog_GetFileName(pfsd,
NULL);
646 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
651 hr = IFileOpenDialog_GetFileTypeIndex(pfod,
NULL);
654 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
657 hr = IFileSaveDialog_GetFileTypeIndex(pfsd,
NULL);
660 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
665 hr = IFileOpenDialog_SetFileTypes(pfod, 0,
NULL);
667 hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
670 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
672 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 1);
674 hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
676 hr = IFileOpenDialog_SetFileTypes(pfod, 0, filterspec);
678 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 0);
680 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
683 hr = IFileOpenDialog_SetFileTypeIndex(pfod, 100);
685 hr = IFileOpenDialog_GetFileTypeIndex(pfod, &
filetype);
688 hr = IFileOpenDialog_SetFileTypes(pfod, 1, filterspec);
690 hr = IFileOpenDialog_SetFileTypes(pfod, 1, &filterspec[1]);
693 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
695 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 1);
697 hr = IFileSaveDialog_SetFileTypes(pfsd, 2, filterspec);
699 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
703 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 0);
705 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
708 hr = IFileSaveDialog_SetFileTypeIndex(pfsd, 100);
710 hr = IFileSaveDialog_GetFileTypeIndex(pfsd, &
filetype);
713 hr = IFileSaveDialog_SetFileTypes(pfsd, 1, filterspec);
715 hr = IFileSaveDialog_SetFileTypes(pfsd, 1, &filterspec[1]);
721 hr = IFileOpenDialog_SetFilter(pfod,
NULL);
723 hr = IFileSaveDialog_SetFilter(pfsd,
NULL);
728 hr = IFileOpenDialog_SetFolder(pfod,
NULL);
730 hr = IFileSaveDialog_SetFolder(pfsd,
NULL);
734 hr = IFileOpenDialog_SetDefaultExtension(pfod,
NULL);
736 hr = IFileOpenDialog_SetDefaultExtension(pfod, txt);
738 hr = IFileOpenDialog_SetDefaultExtension(pfod,
null);
741 hr = IFileSaveDialog_SetDefaultExtension(pfsd,
NULL);
743 hr = IFileSaveDialog_SetDefaultExtension(pfsd, txt);
745 hr = IFileSaveDialog_SetDefaultExtension(pfsd,
null);
749 hr = IFileOpenDialog_SetDefaultFolder(pfod,
NULL);
751 hr = IFileSaveDialog_SetDefaultFolder(pfsd,
NULL);
754 hr = IFileOpenDialog_SetDefaultFolder(pfod, psidesktop);
756 hr = IFileSaveDialog_SetDefaultFolder(pfsd, psidesktop);
762 IFileOpenDialog_SetDefaultFolder(pfod, (
void*)0x1234);
763 IFileSaveDialog_SetDefaultFolder(pfsd, (
void*)0x1234);
767 hr = IFileOpenDialog_GetFolder(pfod,
NULL);
770 hr = IFileOpenDialog_GetFolder(pfod, &psi_original);
774 hr = IFileOpenDialog_SetFolder(pfod, psidesktop);
776 hr = IFileOpenDialog_SetFolder(pfod, psi_original);
778 IShellItem_Release(psi_original);
781 hr = IFileSaveDialog_GetFolder(pfsd, &psi_original);
785 hr = IFileSaveDialog_SetFolder(pfsd, psidesktop);
787 hr = IFileSaveDialog_SetFolder(pfsd, psi_original);
789 IShellItem_Release(psi_original);
796 IFileOpenDialog_AddPlace(pfod,
NULL, 0);
797 IFileSaveDialog_AddPlace(pfsd,
NULL, 0);
800 hr = IFileOpenDialog_AddPlace(pfod, psidesktop,
FDAP_TOP + 1);
802 hr = IFileOpenDialog_AddPlace(pfod, psidesktop, FDAP_BOTTOM);
804 hr = IFileOpenDialog_AddPlace(pfod, psidesktop,
FDAP_TOP);
807 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop,
FDAP_TOP + 1);
809 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop, FDAP_BOTTOM);
811 hr = IFileSaveDialog_AddPlace(pfsd, psidesktop,
FDAP_TOP);
815 hr = IFileOpenDialog_SetFileName(pfod,
NULL);
817 hr = IFileOpenDialog_SetFileName(pfod,
null);
821 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
826 hr = IFileOpenDialog_SetFileName(pfod,
NULL);
830 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
834 hr = IFileOpenDialog_SetFileName(pfod, txt);
836 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
841 hr = IFileSaveDialog_SetFileName(pfsd,
NULL);
843 hr = IFileSaveDialog_SetFileName(pfsd,
null);
845 hr = IFileSaveDialog_SetFileName(pfsd, txt);
847 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
853 hr = IFileOpenDialog_SetFileNameLabel(pfod,
NULL);
855 hr = IFileOpenDialog_SetFileNameLabel(pfod,
null);
857 hr = IFileOpenDialog_SetFileNameLabel(pfod, txt);
860 hr = IFileSaveDialog_SetFileNameLabel(pfsd,
NULL);
862 hr = IFileSaveDialog_SetFileNameLabel(pfsd,
null);
864 hr = IFileSaveDialog_SetFileNameLabel(pfsd, txt);
868 hr = IFileOpenDialog_Close(pfod,
S_FALSE);
870 hr = IFileSaveDialog_Close(pfsd,
S_FALSE);
874 hr = IFileOpenDialog_SetOkButtonLabel(pfod,
NULL);
876 hr = IFileOpenDialog_SetOkButtonLabel(pfod,
null);
878 hr = IFileOpenDialog_SetOkButtonLabel(pfod, txt);
880 hr = IFileSaveDialog_SetOkButtonLabel(pfsd,
NULL);
882 hr = IFileSaveDialog_SetOkButtonLabel(pfsd,
null);
884 hr = IFileSaveDialog_SetOkButtonLabel(pfsd, txt);
888 hr = IFileOpenDialog_SetTitle(pfod,
NULL);
890 hr = IFileOpenDialog_SetTitle(pfod,
null);
892 hr = IFileOpenDialog_SetTitle(pfod, txt);
894 hr = IFileSaveDialog_SetTitle(pfsd,
NULL);
896 hr = IFileSaveDialog_SetTitle(pfsd,
null);
898 hr = IFileSaveDialog_SetTitle(pfsd, txt);
907 IFileOpenDialog_GetResults(pfod,
NULL);
909 psia = (
void*)0xdeadbeef;
910 hr = IFileOpenDialog_GetResults(pfod, &psia);
912 ok(psia ==
NULL,
"got %p.\n", psia);
918 hr = IFileOpenDialog_GetSelectedItems(pfod,
NULL);
920 psia = (
void*)0xdeadbeef;
921 hr = IFileOpenDialog_GetSelectedItems(pfod, &psia);
923 ok(psia == (
void*)0xdeadbeef,
"got %p.\n", psia);
933 IFileSaveDialog_ApplyProperties(pfsd, psidesktop,
NULL,
NULL,
NULL);
937 hr = IFileSaveDialog_GetProperties(pfsd,
NULL);
939 pps = (
void*)0xdeadbeef;
940 hr = IFileSaveDialog_GetProperties(pfsd, &pps);
942 ok(pps == (
void*)0xdeadbeef,
"got %p\n", pps);
948 hr = IFileSaveDialog_SetProperties(pfsd,
NULL);
955 hr = IFileSaveDialog_SetCollectedProperties(pfsd,
NULL,
TRUE);
957 hr = IFileSaveDialog_SetCollectedProperties(pfsd,
NULL,
FALSE);
964 hr = IFileSaveDialog_SetSaveAsItem(pfsd,
NULL);
966 hr = IFileSaveDialog_SetSaveAsItem(pfsd, psidesktop);
972 hr = IFileOpenDialog_QueryInterface(pfod, &IID_IFileDialog2, (
void**)&pfd2);
977 hr = IFileDialog2_SetOkButtonLabel(pfd2,
NULL);
979 hr = IFileDialog2_SetOkButtonLabel(pfd2,
null);
981 hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
987 hr = IFileDialog2_SetNavigationRoot(pfd2,
NULL);
989 hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
993 IFileDialog2_Release(pfd2);
996 hr = IFileSaveDialog_QueryInterface(pfsd, &IID_IFileDialog2, (
void**)&pfd2);
1001 hr = IFileDialog2_SetOkButtonLabel(pfd2,
NULL);
1003 hr = IFileDialog2_SetOkButtonLabel(pfd2,
null);
1005 hr = IFileDialog2_SetOkButtonLabel(pfd2, txt);
1011 hr = IFileDialog2_SetNavigationRoot(pfd2,
NULL);
1013 hr = IFileDialog2_SetNavigationRoot(pfd2, psidesktop);
1017 IFileDialog2_Release(pfd2);
1021 IShellItem_Release(psidesktop);
1022 ref = IFileOpenDialog_Release(pfod);
1023 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
1024 ref = IFileSaveDialog_Release(pfsd);
1025 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
1041#define ensure_zero_events(impl) ensure_zero_events_(__FILE__, __LINE__, impl)
1059 hr = IFileDialog_Advise(
pfd, pfde,
NULL);
1064 ok(pfdeimpl->
ref == 1,
"got ref %d\n", pfdeimpl->
ref);
1067 hr = IFileDialog_Unadvise(
pfd, 0);
1069 for(
i = 0;
i < 10;
i++) {
1074 ok(pfdeimpl->
ref == 10+1,
"got ref %d\n", pfdeimpl->
ref);
1077 for(
i = 3;
i < 7;
i++) {
1081 ok(pfdeimpl->
ref == 6+1,
"got ref %d\n", pfdeimpl->
ref);
1084 for(
i = 0;
i < 3;
i++) {
1088 ok(pfdeimpl->
ref == 3+1,
"got ref %d\n", pfdeimpl->
ref);
1091 for(
i = 7;
i < 10;
i++) {
1095 ok(pfdeimpl->
ref == 1,
"got ref %d\n", pfdeimpl->
ref);
1100 ok(pfdeimpl->
ref == 1,
"got ref %d\n", pfdeimpl->
ref);
1106 ok(pfdeimpl->
ref == 1+1,
"got ref %d\n", pfdeimpl->
ref);
1119 IFileDialogEvents_Release(pfde);
1128 trace(
"Testing FileOpenDialog (advise)\n");
1130 &IID_IFileDialog, (
void**)&
pfd);
1133 ref = IFileDialog_Release(
pfd);
1134 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
1136 trace(
"Testing FileSaveDialog (advise)\n");
1138 &IID_IFileDialog, (
void**)&
pfd);
1141 ref = IFileDialog_Release(
pfd);
1142 ok(!
ref,
"Got refcount %d, should have been released.\n",
ref);
1148 const WCHAR filetype1[] = {
'f',
'n',
'a',
'm',
'e',
'1',0};
1149 const WCHAR filetype1_broken[] = {
'f',
'n',
'a',
'm',
'e',
'1',
' ',
'(',
'*',
'.',
't',
'x',
't',
')',0};
1152 ok(cb_filetype !=
NULL ||
broken(cb_filetype ==
NULL),
"Could not find combobox on first attempt\n");
1158 trace(
"Didn't find combobox on first attempt, trying broken string..\n");
1160 ok(
broken(cb_filetype !=
NULL),
"Failed to find combobox on second attempt\n");
1180 const WCHAR fname1[] = {
'f',
'n',
'a',
'm',
'e',
'1', 0};
1181 const WCHAR fspec1[] = {
'*',
'.',
't',
'x',
't',0};
1182 const WCHAR fname2[] = {
'f',
'n',
'a',
'm',
'e',
'2', 0};
1183 const WCHAR fspec2[] = {
'*',
'.',
'e',
'x',
'e',0};
1191 &IID_IFileDialog, (
void**)&
pfd);
1218 IFileDialogEvents_Release(pfde);
1219 ref = IFileDialog_Release(
pfd);
1227 &IID_IFileDialog, (
void**)&
pfd);
1237 hr = IFileDialog_SetFileTypes(
pfd, 2, filterspec);
1260 IFileDialogEvents_Release(pfde);
1261 ref = IFileDialog_Release(
pfd);
1269 &IID_IFileDialog, (
void**)&
pfd);
1279 hr = IFileDialog_SetFileTypes(
pfd, 2, filterspec);
1302 IFileDialogEvents_Release(pfde);
1303 ref = IFileDialog_Release(
pfd);
1329 &IID_IFileSaveDialog, (
void**)&pfsd);
1334 hr = IFileSaveDialog_SetFileTypes(pfsd, fs_count, filterspec);
1340 hr = IFileSaveDialog_SetDefaultExtension(pfsd, defext);
1347 hr = IFileSaveDialog_Advise(pfsd, pfde, &
cookie);
1350 hr = IFileSaveDialog_Show(pfsd,
NULL);
1353 hr = IFileSaveDialog_GetFileName(pfsd, &
filename);
1358 hr = IFileSaveDialog_GetResult(pfsd, &psi);
1361 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1365 IShellItem_Release(psi);
1367 hr = IFileSaveDialog_Unadvise(pfsd,
cookie);
1370 ref = IFileSaveDialog_Release(pfsd);
1373 IFileDialogEvents_Release(pfde);
1375#define test_filename_savedlg(set_filename, defext, filterspec, fs_count, exp_filename) \
1376 test_filename_savedlg_(set_filename, defext, filterspec, fs_count, exp_filename, __FILE__, __LINE__)
1382 IFileOpenDialog *pfod;
1387 IShellItemArray *psia;
1393 &IID_IFileOpenDialog, (
void**)&pfod);
1398 hr = IFileOpenDialog_SetDefaultExtension(pfod, defext);
1404 hr = IFileOpenDialog_SetFileTypes(pfod, 2, filterspec);
1408 hr = IFileOpenDialog_SetFolder(pfod, psi_current);
1415 hr = IFileOpenDialog_Advise(pfod, pfde, &
cookie);
1418 hr = IFileOpenDialog_Show(pfod,
NULL);
1420 "Show failed: Got 0x%08x\n",
hr);
1423 hr = IFileOpenDialog_GetResult(pfod, &psi);
1426 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1430 IShellItem_Release(psi);
1432 hr = IFileOpenDialog_GetResults(pfod, &psia);
1434 hr = IShellItemArray_GetItemAt(psia, 0, &psi);
1437 hr = IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &
filename);
1442 IShellItem_Release(psi);
1443 IShellItemArray_Release(psia);
1447 hr = IFileOpenDialog_GetResult(pfod, &psi);
1450 hr = IFileOpenDialog_GetResults(pfod, &psia);
1454 hr = IFileOpenDialog_GetFileName(pfod, &
filename);
1460 hr = IFileOpenDialog_Unadvise(pfod,
cookie);
1463 ref = IFileOpenDialog_Release(pfod);
1466 IFileDialogEvents_Release(pfde);
1468#define test_filename_opendlg(set_filename, psi, defext, filterspec, fs_count, exp_filename) \
1469 test_filename_opendlg_(set_filename, psi, defext, filterspec, fs_count, exp_filename, __FILE__, __LINE__)
1477 static const WCHAR filename_noextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',0};
1478 static const WCHAR filename_dotextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',0};
1479 static const WCHAR filename_dotanddefW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'.',
'w',
't',
'e',0};
1480 static const WCHAR filename_defextW[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'e',0};
1481 static const WCHAR filename_ext1W[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'1',0};
1482 static const WCHAR filename_ext2W[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'2',0};
1483 static const WCHAR filename_ext1anddefW[] =
1484 {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'w',
't',
'1',
'.',
'w',
't',
'e',0};
1485 static const WCHAR defextW[] = {
'w',
't',
'e',0};
1486 static const WCHAR desc1[] = {
'd',
'e',
's',
'c',
'r',
'i',
'p',
't',
'i',
'o',
'n',
'1',0};
1487 static const WCHAR desc2[] = {
'd',
'e',
's',
'c',
'r',
'i',
'p',
't',
'i',
'o',
'n',
'2',0};
1488 static const WCHAR descdef[] = {
'd',
'e',
'f',
'a',
'u',
'l',
't',
' ',
'd',
'e',
's',
'c',0};
1489 static const WCHAR ext1[] = {
'*',
'.',
'w',
't',
'1',0};
1490 static const WCHAR ext2[] = {
'*',
'.',
'w',
't',
'2',0};
1491 static const WCHAR extdef[] = {
'*',
'.',
'w',
't',
'e',0};
1492 static const WCHAR complexext[] = {
'*',
'.',
'w',
't',
'2',
';',
'*',
'.',
'w',
't',
'1',0};
1495 { desc1,
ext1 }, { desc2,
ext2 }, { descdef, extdef }
1498 { desc1, complexext }
1519 ok(!!pSHCreateItemFromParsingName,
"SHCreateItemFromParsingName is missing.\n");
1520 hr = pSHCreateItemFromParsingName(
buf,
NULL, &IID_IShellItem, (
void**)&psi_current);
1541 IShellItem_Release(psi_current);
1548static const WCHAR menuW[] = {
'm',
'e',
'n',
'u',
'_',
'i',
't',
'e',
'm',0};
1549static const WCHAR pushbutton1W[] = {
'p',
'u',
's',
'h',
'b',
'u',
't',
't',
'o',
'n',
'_',
'i',
't',
'e',
'm',0};
1550static const WCHAR pushbutton2W[] = {
'p',
'u',
's',
'h',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1551static const WCHAR comboboxitem1W[] = {
'c',
'o',
'm',
'b',
'o',
'b',
'o',
'x',
'1',
'_',
'i',
't',
'e',
'm',0};
1552static const WCHAR comboboxitem2W[] = {
'c',
'o',
'm',
'b',
'o',
'b',
'o',
'x',
'2',
'_',
'i',
't',
'e',
'm',0};
1553static const WCHAR radiobutton1W[] = {
'r',
'a',
'd',
'i',
'o',
'b',
'u',
't',
't',
'o',
'n',
'1',
'_',
'i',
't',
'e',
'm',0};
1554static const WCHAR radiobutton2W[] = {
'r',
'a',
'd',
'i',
'o',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1555static const WCHAR checkbutton1W[] = {
'c',
'h',
'e',
'c',
'k',
'b',
'u',
't',
't',
'o',
'n',
'1',
'_',
'i',
't',
'e',
'm',0};
1556static const WCHAR checkbutton2W[] = {
'c',
'h',
'e',
'c',
'k',
'b',
'u',
't',
't',
'o',
'n',
'2',
'_',
'i',
't',
'e',
'm',0};
1557static const WCHAR editbox1W[] = {
'e',
'd',
'i',
't',
'b',
'o',
'x',
'W',
'1',
'_',
'i',
't',
'e',
'm',0};
1558static const WCHAR editbox2W[] = {
'e',
'd',
'i',
't',
'b',
'o',
'x',
'W',
'2',
'_',
'i',
't',
'e',
'm',0};
1559static const WCHAR textW[] = {
't',
'e',
'x',
't',
'_',
'i',
't',
'e',
'm',0};
1560static const WCHAR text2W[] = {
't',
'e',
'x',
't',
'2',
'_',
'i',
't',
'e',
'm',0};
1561static const WCHAR separatorW[] = {
's',
'e',
'p',
'a',
'r',
'a',
't',
'o',
'r',
'_',
'i',
't',
'e',
'm',0};
1562static const WCHAR visualgroup1W[] = {
'v',
'i',
's',
'u',
'a',
'l',
'g',
'r',
'o',
'u',
'p',
'1',0};
1563static const WCHAR visualgroup2W[] = {
'v',
'i',
's',
'u',
'a',
'l',
'g',
'r',
'o',
'u',
'p',
'2',0};
1565static const WCHAR floatnotifysinkW[] = {
'F',
'l',
'o',
'a',
't',
'N',
'o',
't',
'i',
'f',
'y',
'S',
'i',
'n',
'k',0};
1566static const WCHAR RadioButtonListW[] = {
'R',
'a',
'd',
'i',
'o',
'B',
'u',
't',
't',
'o',
'n',
'L',
'i',
's',
't',0};
1577 ok(dlg_hwnd !=
NULL,
"Got NULL.\n");
1630 IFileDialogCustomize *pfdc;
1634 CDCONTROLSTATEF cdstate;
1638 UINT id_vgroup1, id_text, id_editbox1;
1643 &IID_IFileDialog, (
void**)&pfod);
1646 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
1650 skip(
"Skipping IFileDialogCustomize tests.\n");
1651 IFileDialog_Release(pfod);
1663 hr = IOleWindow_GetWindow(
pow, &dlg_hwnd);
1665 ok(dlg_hwnd ==
NULL,
"NULL\n");
1666 IOleWindow_Release(
pow);
1668 cdstate = 0xdeadbeef;
1669 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1673 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1676 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1677 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1679 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i);
1681 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++
i);
1684 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i);
1686 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc,
i+1);
1689 cdstate = 0xdeadbeef;
1690 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1692 ok(cdstate == 0xdeadbeef,
"got 0x%08x.\n", cdstate);
1694 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1696 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1699 cdstate = 0xdeadbeef;
1700 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1703 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
1705 cdstate = 0xdeadbeef;
1706 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1708 ok(!cdstate,
"got 0x%08x.\n", cdstate);
1711 cdstate = 0xdeadbeef;
1712 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1716 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1719 hr = IFileDialogCustomize_AddMenu(pfdc,
i,
menuW);
1721 hr = IFileDialogCustomize_AddMenu(pfdc, ++
i,
label);
1724 cdstate = 0xdeadbeef;
1725 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1729 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1731 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1734 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1735 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1742 cdstate = 0xdeadbeef;
1743 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1747 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1750 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1751 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1753 hr = IFileDialogCustomize_AddComboBox(pfdc,
i);
1755 hr = IFileDialogCustomize_AddComboBox(pfdc, ++
i);
1758 cdstate = 0xdeadbeef;
1759 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1763 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1765 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1768 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1769 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1771 hr = IFileDialogCustomize_AddRadioButtonList(pfdc,
i);
1773 hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++
i);
1776 cdstate = 0xdeadbeef;
1777 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1787 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1789 hr = IFileDialogCustomize_AddCheckButton(pfdc,
i,
label,
TRUE);
1794 cdstate = 0xdeadbeef;
1795 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1799 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1803 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1808 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1810 ok(checked,
"checkbox not checked.\n");
1812 hr = IFileDialogCustomize_SetCheckButtonState(pfdc,
i,
FALSE);
1815 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1817 ok(!checked,
"checkbox checked.\n");
1819 hr = IFileDialogCustomize_SetCheckButtonState(pfdc,
i,
TRUE);
1822 hr = IFileDialogCustomize_GetCheckButtonState(pfdc,
i, &checked);
1824 ok(checked,
"checkbox not checked.\n");
1827 hr = IFileDialogCustomize_AddEditBox(pfdc,
i,
label);
1829 hr = IFileDialogCustomize_AddEditBox(pfdc, ++
i,
editbox1W);
1832 cdstate = 0xdeadbeef;
1833 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1837 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1841 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
editbox2W);
1842 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1844 hr = IFileDialogCustomize_GetEditBoxText(pfdc,
i, &tmpstr);
1852 hr = IFileDialogCustomize_SetEditBoxText(pfdc,
i,
label2);
1855 hr = IFileDialogCustomize_GetEditBoxText(pfdc,
i, &tmpstr);
1863 hr = IFileDialogCustomize_AddSeparator(pfdc,
i);
1865 hr = IFileDialogCustomize_AddSeparator(pfdc, ++
i);
1868 cdstate = 0xdeadbeef;
1869 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1873 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1876 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
separatorW);
1877 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1879 hr = IFileDialogCustomize_AddText(pfdc,
i,
label);
1881 hr = IFileDialogCustomize_AddText(pfdc, ++
i,
textW);
1884 cdstate = 0xdeadbeef;
1885 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1889 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1892 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
text2W);
1893 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1895 hr = IFileDialogCustomize_StartVisualGroup(pfdc,
i,
label);
1900 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1904 ok(
hr ==
S_OK,
"got 0x%08x (control: %d).\n",
hr,
i);
1906 cdstate = 0xdeadbeef;
1907 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1911 hr = IFileDialogCustomize_StartVisualGroup(pfdc, ++
i,
label);
1913 hr = IFileDialogCustomize_EndVisualGroup(pfdc);
1917 hr = IFileDialogCustomize_AddControlItem(pfdc,
i, 0,
label);
1919 hr = IFileDialogCustomize_SetControlLabel(pfdc,
i,
label2);
1921 cdstate = 0xdeadbeef;
1922 hr = IFileDialogCustomize_GetControlState(pfdc,
i, &cdstate);
1924 ok(cdstate == 0xdeadbeef,
"got 0x%08x.\n", cdstate);
1929 hr = IFileDialog_Advise(pfod, pfde, &
cookie);
1932 hr = IFileDialog_Show(pfod,
NULL);
1935 hr = IFileDialog_Unadvise(pfod,
cookie);
1938 IFileDialogEvents_Release(pfde);
1939 IFileDialogCustomize_Release(pfdc);
1940 ref = IFileDialog_Release(pfod);
1941 ok(!
ref,
"Refcount not zero (%d).\n",
ref);
1945 &IID_IFileDialog, (
void**)&pfod);
1948 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
1952 hr = IFileDialogCustomize_AddMenu(pfdc, ++
i,
label);
1959 for(
j = 0;
j < 10;
j++)
1961 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
1965 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
1968 cdstate = 0xdeadbeef;
1969 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1972 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
1974 cdstate = 0xdeadbeef;
1975 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1977 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
1980 cdstate = 0xdeadbeef;
1981 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
1985 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
1988 for(
j = 0;
j < 10;
j++)
1990 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
1994 hr = IFileDialogCustomize_AddPushButton(pfdc, ++
i,
label);
1996 hr = IFileDialogCustomize_AddComboBox(pfdc, ++
i);
2003 for(
j = 0;
j < 10;
j++)
2005 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2009 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2013 cdstate = 0xdeadbeef;
2014 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2017 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2019 cdstate = 0xdeadbeef;
2020 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2022 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2025 cdstate = 0xdeadbeef;
2026 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2030 for(
j = 0;
j < 10;
j++)
2032 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2034 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2039 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2042 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2045 for(
j = 0;
j < 10;
j++)
2047 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2052 hr = IFileDialogCustomize_AddRadioButtonList(pfdc, ++
i);
2059 for(
j = 0;
j < 10;
j++)
2061 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2065 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2069 cdstate = 0xdeadbeef;
2070 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2073 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2075 cdstate = 0xdeadbeef;
2076 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2078 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2081 cdstate = 0xdeadbeef;
2082 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2086 for(
j = 0;
j < 10;
j++)
2088 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2090 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2095 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i,
j);
2098 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2101 for(
j = 0;
j < 10;
j++)
2103 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2107 hr = IFileDialogCustomize_EnableOpenDropDown(pfdc, ++
i);
2114 for(
j = 0;
j < 10;
j++)
2116 hr = IFileDialogCustomize_AddControlItem(pfdc,
i,
j,
label);
2120 hr = IFileDialogCustomize_GetSelectedControlItem(pfdc,
i, &
selected);
2124 cdstate = 0xdeadbeef;
2125 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2128 hr = IFileDialogCustomize_SetControlItemState(pfdc,
i, 0, 0);
2130 cdstate = 0xdeadbeef;
2131 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2133 ok(cdstate == 0,
"got 0x%08x.\n", cdstate);
2136 cdstate = 0xdeadbeef;
2137 hr = IFileDialogCustomize_GetControlItemState(pfdc,
i, 0, &cdstate);
2140 hr = IFileDialogCustomize_SetSelectedControlItem(pfdc,
i, 0);
2143 hr = IFileDialogCustomize_RemoveAllControlItems(pfdc,
i);
2146 for(
j = 0;
j < 10;
j++)
2148 hr = IFileDialogCustomize_RemoveControlItem(pfdc,
i,
j);
2153 IFileDialogCustomize_Release(pfdc);
2154 ref = IFileDialog_Release(pfod);
2155 ok(!
ref,
"Refcount not zero (%d).\n",
ref);
2160 &IID_IFileDialog, (
void**)&pfod);
2163 hr = IFileDialog_QueryInterface(pfod, &IID_IFileDialogCustomize, (
void**)&pfdc);
2168 hr = IFileDialogCustomize_StartVisualGroup(pfdc, id_vgroup1,
visualgroup1W);
2171 cdstate = 0xdeadbeef;
2172 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2177 hr = IFileDialogCustomize_AddText(pfdc, id_text,
label);
2180 cdstate = 0xdeadbeef;
2181 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2186 hr = IFileDialogCustomize_AddEditBox(pfdc, id_editbox1,
editbox1W);
2189 cdstate = 0xdeadbeef;
2190 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2196 hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1,
CDCS_VISIBLE);
2199 cdstate = 0xdeadbeef;
2200 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2203 cdstate = 0xdeadbeef;
2205 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2209 cdstate = 0xdeadbeef;
2210 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2215 hr = IFileDialogCustomize_SetControlState(pfdc, id_text,
CDCS_VISIBLE);
2218 cdstate = 0xdeadbeef;
2219 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2222 cdstate = 0xdeadbeef;
2224 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2228 cdstate = 0xdeadbeef;
2229 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2234 hr = IFileDialogCustomize_SetControlState(pfdc, id_vgroup1, CDCS_INACTIVE);
2237 cdstate = 0xdeadbeef;
2238 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2240 ok(cdstate == CDCS_INACTIVE,
"got 0x%08x.\n", cdstate);
2242 cdstate = 0xdeadbeef;
2243 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2247 cdstate = 0xdeadbeef;
2248 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2256 cdstate = 0xdeadbeef;
2257 hr = IFileDialogCustomize_GetControlState(pfdc, id_vgroup1, &cdstate);
2261 cdstate = 0xdeadbeef;
2262 hr = IFileDialogCustomize_GetControlState(pfdc, id_text, &cdstate);
2266 cdstate = 0xdeadbeef;
2267 hr = IFileDialogCustomize_GetControlState(pfdc, id_editbox1, &cdstate);
2271 hr = IFileDialogCustomize_MakeProminent(pfdc, id_vgroup1);
2274 IFileDialogCustomize_Release(pfdc);
2275 ref = IFileDialog_Release(pfod);
2276 ok(!
ref,
"Refcount not zero (%d).\n",
ref);
2285 &IID_IFileDialog, (
void**)&
fd);
2291 hr = IFileDialog_SetClientGuid(
fd,
NULL);
2300 IFileDialog_Release(
fd);
2305 static const WCHAR filename_winetest[] = {
'w',
'i',
'n',
'e',
't',
'e',
's',
't',
'.',
'o',
'v',
'w',0};
2316 ok(!!pSHCreateItemFromParsingName,
"SHCreateItemFromParsingName is missing.\n");
2317 hr = pSHCreateItemFromParsingName(
buf,
NULL, &IID_IShellItem, (
void**)&psi_current);
2324 &IID_IFileDialog, (
void**)&
fd);
2327 hr = IFileDialog_SetOptions(
fd, FOS_OVERWRITEPROMPT | FOS_NOCHANGEDIR);
2330 hr = IFileDialog_SetFolder(
fd, psi_current);
2337 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08x\n",
hr);
2340 ok(
hr ==
S_OK,
"Show failed: Got 0x%08x\n",
hr);
2346 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08x\n",
hr);
2353 IFileDialog_Release(
fd);
2355 IFileDialogEvents_Release(pfde);
2359 &IID_IFileDialog, (
void**)&
fd);
2362 hr = IFileDialog_SetOptions(
fd, FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR);
2365 hr = IFileDialog_SetFolder(
fd, psi_current);
2372 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08x\n",
hr);
2375 ok(
hr ==
S_OK,
"Show failed: Got 0x%08x\n",
hr);
2381 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08x\n",
hr);
2388 IFileDialog_Release(
fd);
2390 IFileDialogEvents_Release(pfde);
2394 &IID_IFileDialog, (
void**)&
fd);
2397 hr = IFileDialog_SetFolder(
fd, psi_current);
2404 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08x\n",
hr);
2407 ok(
hr ==
S_OK,
"Show failed: Got 0x%08x\n",
hr);
2413 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08x\n",
hr);
2420 IFileDialog_Release(
fd);
2422 IFileDialogEvents_Release(pfde);
2428 &IID_IFileDialog, (
void**)&
fd);
2431 hr = IFileDialog_SetFolder(
fd, psi_current);
2438 ok(
hr ==
S_OK,
"Advise failed: Got 0x%08x\n",
hr);
2441 ok(
hr ==
S_OK,
"Show failed: Got 0x%08x\n",
hr);
2447 ok(
hr ==
S_OK,
"GetFileName failed: Got 0x%08x\n",
hr);
2454 IFileDialog_Release(
fd);
2456 IFileDialogEvents_Release(pfde);
2458 IShellItem_Release(psi_current);
2477 skip(
"Skipping all Item Dialog tests.\n");
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
EXTERN_C HRESULT WINAPI SHCreateShellItem(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psfParent, PCUITEMID_CHILD pidl, IShellItem **ppsi)
#define InterlockedIncrement
#define InterlockedDecrement
static char selected[MAX_PATH+1]
static const WCHAR floatnotifysinkW[]
#define GetCurrentDirectoryW(x, y)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define FILE_ATTRIBUTE_NORMAL
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static PEXPLICIT_ACCESSW *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 HWND get_hwnd_from_ifiledialog(IFileDialog *pfd)
static const WCHAR radiobutton1W[]
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)
#define test_filename_opendlg(set_filename, psi, defext, filterspec, fs_count, exp_filename)
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[]
static void test_customize_onfolderchange(IFileDialog *pfd)
static void test_filename_opendlg_(LPCWSTR set_filename, IShellItem *psi_current, LPCWSTR defext, const COMDLG_FILTERSPEC *filterspec, UINT fs_count, LPCWSTR exp_filename, const char *file, int line)
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)
#define test_filename_savedlg(set_filename, defext, filterspec, fs_count, exp_filename)
static IFileDialogEventsImpl * impl_from_IFileDialogEvents(IFileDialogEvents *iface)
static void test_filename_savedlg_(LPCWSTR set_filename, LPCWSTR defext, const COMDLG_FILTERSPEC *filterspec, UINT fs_count, LPCWSTR exp_filename, const char *file, int line)
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)
static BOOL test_instantiation(void)
static const WCHAR pushbutton1W[]
static void test_customize(void)
static void test_events(void)
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)
FDE_SHAREVIOLATION_RESPONSE
HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv)
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)
#define HRESULT_FROM_WIN32(x)
#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)