Recent

Author Topic: TWin32WSSelectDirectoryDialog with UseVistaDialogs?  (Read 5599 times)

lks

  • New Member
  • *
  • Posts: 12
TWin32WSSelectDirectoryDialog with UseVistaDialogs?
« on: November 26, 2012, 12:30:59 am »
I notice that that implementation uses the older SHBrowseForFolder interface instead of the more modern IFileDialog interface used by the rest of the file/open dialogs.  Any reason not to use this?

For now, I have modified the TOpenDialog interface to accept an option that eventually invokes the Vista dialog with FOS_PICKFOLDERS, and it seems to work fine, so I would think it is pretty easy to add this support in the TWin32WSelectDirectoryDialog methods since it already exists in TWin32WSOpenDialog.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TWin32WSSelectDirectoryDialog with UseVistaDialogs?
« Reply #1 on: November 26, 2012, 08:15:30 am »
You could alway open an issue in the bug tracker and attach your patch as you already did much of the work.

Just make sure it will work on older systems as well (e.g. Windows 2000)...

(Personnally, if the new dialog is the one were you can actually type in your desired directory instead of having to click till you turn blue, I'd be very happy with it ;) )
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

guitarmang

  • New Member
  • *
  • Posts: 31
Re: TWin32WSSelectDirectoryDialog with UseVistaDialogs?
« Reply #2 on: November 30, 2014, 03:55:24 am »
Sorry to reply to an older post,
but I was curious on what kind of patch that user lks used. Is there anyway these options to use the new Vista style dialogs could be used, and be used with the classic theme? Here's some code from the win32wsdialogs starting on line 755:
Code: [Select]
{ TWin32WSOpenDialog }
{$ifdef UseVistaDialogs}
class procedure TWin32WSOpenDialog.SetupVistaFileDialog(ADialog: IFileDialog; const AOpenDialog: TOpenDialog);
{ non-used flags
FOS_PICKFOLDERS
FOS_FORCEFILESYSTEM
FOS_ALLNONSTORAGEITEMS
FOS_HIDEMRUPLACES
FOS_HIDEPINNEDPLACES
FOS_DONTADDTORECENT
FOS_DEFAULTNOMINIMODE
FOS_FORCEPREVIEWPANEON}

Thanks, Wyatt
« Last Edit: November 30, 2014, 04:06:08 am by guitarmang »

Bart

  • Hero Member
  • *****
  • Posts: 3539
    • Bart en Mariska's Webstek
Re: TWin32WSSelectDirectoryDialog with UseVistaDialogs?
« Reply #3 on: November 30, 2014, 11:16:20 am »
Lazarus uses the new Vista dialogs if:
  • Themes are enabled (for the project that is)
  • Windows version >= Vista

There is a bugreport requesting the use of Vista dialogs, indepently from the value of Themes enabled.

Bart

guitarmang

  • New Member
  • *
  • Posts: 31
Re: TWin32WSSelectDirectoryDialog with UseVistaDialogs?
« Reply #4 on: May 24, 2015, 09:50:40 pm »
Hi,
I see that there is a patch related to this now.

Is they a way you guys could include FOS_PICKFOLDERS in the options of the TOpenDialog?
Thanks, Wyatt