From 53911c79b56f4ef35450d7b672c8b9087498e72e Mon Sep 17 00:00:00 2001 From: bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Thu, 12 Mar 2015 17:23:30 +0000 Subject: [PATCH] Win32: Use Vista dialogs independant from status of ThemesEnabled also for Open/SavePicturDialog. Issue #0026940. git-svn-id: trunk@48301 - --- lcl/interfaces/win32/win32wsdialogs.pp | 4 ++++ lcl/interfaces/win32/win32wsextdlgs.pp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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