Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Open File Dialog

  1. #11
    Join Date
    Feb 2009
    Location
    Dallas, TX USA
    Posts
    1,533

    Default Re: Open File Dialog

    Looks nice Peter.

  2. #12
    Join Date
    Feb 2009
    Location
    Kingsbridge, S.Devon, England
    Posts
    1,491

    Default Re: Open File Dialog

    Thx Mark, hope you find it useful too!
    Peter Crook
    ------------------------------------------------------------------------------------
    Everything should be made as simple as possible, but not simpler.
    -- Albert Einstein

  3. #13

    Default Re: Open File Dialog

    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
    Attached Files Attached Files
    Last edited by wila; 2-Oct-2017 at 06:55 AM. Reason: added links to MSDN

  4. #14
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    1,830

    Default Re: Open File Dialog

    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.
    Attached Files Attached Files
    Regards,
    Raveen Sundram

    Software Development Manager
    Excellent Software Ltd
    Auckland, New Zealand
    www.helixretail.co.nz


  5. #15

    Default Re: Open File Dialog

    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

  6. #16
    Join Date
    Feb 2009
    Posts
    862

    Default Re: Open File Dialog

    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.

  7. #17
    Join Date
    Mar 2009
    Location
    New Zealand
    Posts
    1,830

    Default Re: Open File Dialog

    Quote Originally Posted by Jose View Post
    Is it working TVM_ENSUREVISIBLE?
    Yes - it is. If it doesnt for you - you might want to increase the timer timeout or increase the maxtries
    Regards,
    Raveen Sundram

    Software Development Manager
    Excellent Software Ltd
    Auckland, New Zealand
    www.helixretail.co.nz


  8. #18
    Join Date
    Feb 2009
    Posts
    862

    Default Re: Open File Dialog

    Hello Raveen,

    I have found the problem.

    Code:
    Move (FindWindow("#32770","Browse For Folder")) to hWnd
    I have my operating system configured in spanish, so the caption of the dialog is "Buscar carpeta", not "Browse For Folder".

    Knowing this I tried to parameterize the caption, but no luck.
    I have changed

    Code:
    Get BrowseDialogEx sPath sTitle "" (BIF_RETURNONLYFSDIRS ior BIF_NEWDIALOGSTYLE) to sPath
    to

    Code:
    Get BrowseDialogEx sPath sTitle "MyCaption" (BIF_RETURNONLYFSDIRS ior BIF_NEWDIALOGSTYLE) to sPath
    and obviously the conditional

    Code:
    Move (FindWindow("#32770","MyCaption")) to hWnd
    It seems that the caption can't be setup because it still shows "Buscar carpeta" after this change.

    Regards.
    We are always in a continuous learning mode, and the more we know, the more we realise that we don't know anything.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Jailed "File Open" Dialog.
    By seanyboy in forum Windows Applications
    Replies: 2
    Last Post: 25-Jun-2009, 06:51 AM
  2. Open workspace dialog
    By JimNC9 in forum Reports
    Replies: 3
    Last Post: 16-Jun-2009, 10:46 PM
  3. Open file (not) dialog
    By Bob Worsley in forum Windows Applications
    Replies: 4
    Last Post: 14-Feb-2007, 12:12 PM
  4. Open File Dialog
    By David Martinko in forum Windows Applications
    Replies: 2
    Last Post: 22-Sep-2006, 07:38 AM
  5. Open File Dialog
    By Sam Neuner in forum Windows Applications
    Replies: 6
    Last Post: 11-Aug-2005, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •