Win32: TWin32WSSavePictureDialog: setting FOS_FORCEPREVIEWPANEON on a Vista Save dialog has no effect, so don't force setting it.

This commit is contained in:
Bart 2025-07-16 19:08:06 +02:00
parent 8801d4e986
commit 08f783a09a

View File

@ -205,16 +205,10 @@ begin
Result := inherited CreateHandle(ACommonDialog);
if (Result = 0) or (Result = INVALID_HANDLE_VALUE) then
Exit;
if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) and not IsXPStyleFallBack(TOpenDialog(ACommonDialog)) then
begin
Dialog := IFileSaveDialog(Result);
if Succeeded(Dialog.GetOptions(@fos)) then
begin
fos := fos or FOS_FORCEPREVIEWPANEON;
Dialog.SetOptions(fos);
end;
end
else
// According to https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/ne-shobjidl_core-_fileopendialogoptions
// FOS_FORCEPREVIEWPANEON has no effect on a save dialog.
// So don't bother in that case
if (not CanUseVistaDialogs(TOpenDialog(ACommonDialog))) or IsXPStyleFallBack(TOpenDialog(ACommonDialog)) then
AddPreviewControl(ACommonDialog, LPOPENFILENAME(Result));
end;