diff --git a/lcl/interfaces/win32/win32wsdialogs.pp b/lcl/interfaces/win32/win32wsdialogs.pp index 63274f345d..9346762fed 100644 --- a/lcl/interfaces/win32/win32wsdialogs.pp +++ b/lcl/interfaces/win32/win32wsdialogs.pp @@ -156,6 +156,10 @@ procedure RestoreApplicationState(AState: TApplicationState); function UTF8StringToPWideChar(const s: string) : PWideChar; function UTF8StringToPAnsiChar(const s: string) : PAnsiChar; +{$ifdef UseVistaDialogs} +function CanUseVistaDialogs(const AOpenDialog: TOpenDialog): Boolean; +{$endif} + implementation function SaveApplicationState: TApplicationState; diff --git a/lcl/interfaces/win32/win32wsextdlgs.pp b/lcl/interfaces/win32/win32wsextdlgs.pp index a48308e4b0..068147f9e9 100644 --- a/lcl/interfaces/win32/win32wsextdlgs.pp +++ b/lcl/interfaces/win32/win32wsextdlgs.pp @@ -171,7 +171,8 @@ var begin Result := inherited CreateHandle(ACommonDialog); {$ifdef UseVistaDialogs} - if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then + //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then + if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then begin Dialog := IFileOpenDialog(Result); if Succeeded(Dialog.GetOptions(@fos)) then @@ -217,7 +218,8 @@ var begin Result := inherited CreateHandle(ACommonDialog); {$ifdef UseVistaDialogs} - if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then + //if (WindowsVersion >= wvVista) and ThemeServices.ThemesEnabled then + if CanUseVistaDialogs(TOpenDialog(ACommonDialog)) then begin Dialog := IFileSaveDialog(Result); if Succeeded(Dialog.GetOptions(@fos)) then