Looks nice Peter.
Looks nice Peter.
Thx Mark, hope you find it useful too!
Peter Crook
------------------------------------------------------------------------------------
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
Hi,
Over time I have been asked for numerous of settings by changing the Flags passed to the shBrowseForFolder API call.
Now instead of me setting it to a fixed flag I made a new version where you can customize it and set your own flags to your needs.
As a demo I only set the new folder dialog (BIF_NEWDIALOGSTYLE = $0040 or decimal 64), but you can set it to anything that the MSDN windows API call supports.
relevant MSDN links shBrowseForFolder:
https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
and for the settings (BIF_xxxxx) see
https://msdn.microsoft.com/en-us/lib...=vs.85%29.aspx
cheers!
-
Wil
Last edited by wila; 2-Oct-2017 at 06:55 AM. Reason: added links to MSDN
Hi Wil,
Minor fix to the new dialog style - basically to fix a Microsoft bug within the common controls
The designer of this dialog elected not to send the TreeView control a TVM_ENSUREVISIBLE message after the dialog is displayed and an initial folder is selected.
The TVM_ENSUREVISIBLE message causes a TreeView control to scroll so that the currently selected item is visible in the window.
Therefore, added code to 'fix' this UI issue by sending the TVM_ENSUREVISIBLE message directly to the treeview after the dialog is created.
Also, removed the need of the second folder DF-dialog - created a new boolean pbUseNewDialogStyle property that can be set via the prompt_callback.
See attached.
Regards,
Raveen Sundram
Software Development Manager
Excellent Software Ltd
Auckland, New Zealand
www.helixretail.co.nz
Thanks Raveen!
Sorry about that 2nd dialog, I was in a hurry and only paid attention to the code in the DLL.
This was the quickest way to test and get you the new DLL, after all, you got it same day you asked
Strange MS bug, but good to see you found a workaround for it.
thanks again!
-
Wil
Hello Raveen,
Is it working TVM_ENSUREVISIBLE?
In my case the treeview scrolls down until the logic unit (C:, D:, E:...) that contains the current selected folder, so, I am not seeing the current selected folder. If I want to see the current selected folder I have to scroll down manually.
Also I have to do "Set psTitle of hoPrompt to (ToANSI("Text"))" because the text have special characters. It would be a good idea not have to deal with this, but implementing this on the class would broke compatibility if someone is doing ToANSI.
Regards.
We are always in a continuous learning mode, and the more we know, the more we realise that we don't know anything.
Regards,
Raveen Sundram
Software Development Manager
Excellent Software Ltd
Auckland, New Zealand
www.helixretail.co.nz
Hello Raveen,
I have found the problem.
I have my operating system configured in spanish, so the caption of the dialog is "Buscar carpeta", not "Browse For Folder".Code:Move (FindWindow("#32770","Browse For Folder")) to hWnd
Knowing this I tried to parameterize the caption, but no luck.
I have changed
toCode:Get BrowseDialogEx sPath sTitle "" (BIF_RETURNONLYFSDIRS ior BIF_NEWDIALOGSTYLE) to sPath
and obviously the conditionalCode:Get BrowseDialogEx sPath sTitle "MyCaption" (BIF_RETURNONLYFSDIRS ior BIF_NEWDIALOGSTYLE) to sPath
It seems that the caption can't be setup because it still shows "Buscar carpeta" after this change.Code:Move (FindWindow("#32770","MyCaption")) to hWnd
Regards.
We are always in a continuous learning mode, and the more we know, the more we realise that we don't know anything.