Win32: Use Vista dialogs independant from status of ThemesEnabled also for Open/SavePicturDialog. Issue #0026940.

git-svn-id: trunk@48301 -
This commit is contained in:
bart 2015-03-12 17:23:30 +00:00
parent 4b6ad199fd
commit 53911c79b5
2 changed files with 8 additions and 2 deletions

View File

@ -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;

View File

@ -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