GUI ScreenIO for Windows

 ScreenIO.com


BrowseForFolder

This API displays the standard Windows Folder Browse Dialog which allows the user to select a directory; use GetOpenFilename to obtain a filename

Note:  BrowseForFolder has options which will allow file selection as well, same as GetOpenFileName. 

The dialog varies depending on the version of Windows.  For example, some versions offer a "Create New Folder" button.  These differences are noted below.

Client/Server issues

No issues; this API will behave as if it were running locally on the client.

Files

Files available to copy to your system:

Usage

      COPY WIN32API.
      COPY GETFOLDR.
       .

       .

       .

* ------------------------: Load the window handle of the window
*                         : that will own this dialog; (it's
*                         : passed back by GUI ScreenIO when you
*                         : display a panel).

     MOVE mypanel-HWND TO FOLDERBROWSE-HWNDOWNER
*
* ------------------------: Load the dialog title and text.
*
     STRING 'My Browse-for-Folder Title'
            LOW-VALUE
            DELIMITED SIZE INTO FOLDERBROWSE-TITLE
*
* ------------------------: Load the beginning location for the
*                         : browse, or leave low-values to start
*                         : at the Desktop folder.
*                         : Upon return this will be replaced by
*                         : the selected folder, or low values
*                         : if the cancel button is clicked.
*
     STRING 'C:\PROGRAM FILES\GUI SCREENIO'
            LOW-VALUE
            DELIMITED SIZE INTO FOLDERBROWSE-FOLDERNAME
*
* ------------------------: Clear any previous options in
*                         : preparation to loading our requet

     SET FOLDERBROWSE-INITIALIZE  TO TRUE
*
* ------------------------: Now set the options we want...

     SET FOLDERBROWSE-EDITBOX
         FOLDERBROWSE-INCLUDE-SHARES TO TRUE
*
* ------------------------: Call the GUI ScreenIO API routine:
*
     SET FUNC-BROWSEFORFOLDER TO TRUE
     CALL 'GSWINAPI' USING WIN32API-PARMS
                           FOLDERBROWSE-DATA
                           FOLDERBROWSE-TITLE
                           FOLDERBROWSE-FOLDERNAME
                           DUMMY
                           DUMMY
                           DUMMY
*
     IF WIN32API-FAILED OR FOLDERBROWSE-FOLDERNAME NOT > SPACE
       do no-folder-selected
     ELSE
       process the selected folder name in FOLDERBROWSE-FOLDERNAME
     END-IF

Parameters specific to this function

FOLDERBROWSE-DATA

Specifies the types of things to be shown in the browse and options controlling appearance.

FOLDERBROWSE-TITLE 

The window title for the dialog box

FOLDERBROWSE-FOLDERNAME

Specifies the starting folder for the browse (null-terminated string). 

If not supplied (or invalid), the browse will start at the desktop folder.  Upon return, it will contain an ASCIIZ (null-terminated) string containing the selected folder.  If the function fails, WIN32API will be TRUE and this will contain LOW-VALUE.

Options that you may select:

You may set any of the following to TRUE to select various options. 

We recommend selecting INITIALIZE, EDITBOX, and NEWDIALOGSTYLE for most applications. 

Note that INITIALIZE must be done first; it clears all other settings. 

See the sample application for how to use this API, or to test various combinations of options.

 Flag Description
FOLDERBROWSE-INITIALIZE Clears all other settings in preparation for setting your choices.  Always do this FIRST.
FOLDERBROWSE-FOR-COMPUTERS Include computers on the local network in the dialog display.  This allows users to select directories that exist on other computers in the network.
FOLDERBROWSE-FOR-PRINTERS Includes printers in the list of objects shown in the Dialog box.

Note:  This does not work in later versions of windows.  Even on older versions, unless you start in the proper directory where printers are defined it would fail.  Use GetPrinters API instead.

FOLDERBROWSE-EDITBOX An edit box will appear on the dialog in which users can type a directory name.  May not be available in early Windows 95 machines with original Internet Explorer installations.
FOLDERBROWSE-SHOW-FILES Include (and allow selection of) files in addition to directories.  May not be available in early Windows 95 machines with original Internet Explorer installations
FOLDERBROWSE-INCLUDE-SHARES Shows shares on remote machines (network neighborhood) May not work with early Windows 95/98 systems.
FOLDERBROWSE-SHOW-ONLY-FS-DIRS Don't show pseudo directories (Desktop, My Documents, etc.) that really do not exist in the file system in the locations shown by Explorer.  The actual locations of these pseudo-folders varies with each version of windows. 

You may not be able to actually open a file in one of these virtual directories using COBOL.
FOLDERBROWSE-NO-NEW-FOLDER Suppress the New Folder button on the dialog. 

This button only appears in Windows 2000 and Windows XP.  It may only be suppressed in Windows XP.
FOLDERBROWSE-NEWDIALOGSTYLE Uses the new dialog style when it is available. 

Some options (EDITBOX) force this option.

© 2000-2019 Norcom, all rights reserved 

TOC

Send feedback to Norcom