* :--------------------------------------- * ------------------------: CopyBook for BrowseForFolder * : Used to browse for a folder rather * : than a file, or to find computers * : or printers on the local network. * : Use this when allowing a user to pick * : a directory to store or fetch files. * : This API always runs on the client * : in a client server environment. * : See Documentation for Details * :--------------------------------------- * * To use: * * 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 * * ---------------------------------------------------------------- * 01 FOLDERBROWSE-DATA. 05 FOLDERBROWSE-HWNDOWNER PIC X(4). * : Definitions of supported options: 05 FOLDERBROWSE-OPTIONS. * : Use this first to clear all options * : then set selected options... 88 FOLDERBROWSE-INITIALIZE VALUE LOW-VALUES. * : Browse for Computers on the network 10 FILLER PIC X. 88 FOLDERBROWSE-FOR-COMPUTERS VALUE 'Y'. * : Browse for Printers on the network 10 FILLER PIC X. 88 FOLDERBROWSE-FOR-PRINTERS VALUE 'Y'. * : Shows An edit box into which user * : may type an entry. 10 FILLER PIC X. 88 FOLDERBROWSE-EDITBOX VALUE 'Y'. * : Shows files as well as folders and * : allow selection of either 10 FILLER PIC X. 88 FOLDERBROWSE-SHOW-FILES VALUE 'Y'. * : Include Shares on the networked * : machines. Forces on editbox * : and new dialog style. 10 FILLER PIC X. 88 FOLDERBROWSE-INCLUDE-SHARES VALUE 'Y'. * : Show only real directories that are * : part of the file-system, not virtual * : directories. Example: * : c:\windows\desktop = real * : "Desktop" = Virtual (does not actually * : exist, but "points to" the * : real c:\windows\desktop) * : This is important because you may not * : be able to open a file via a virtual * : directory with COBOL. 10 FILLER PIC X. 88 FOLDERBROWSE-SHOW-ONLY-FS-DIRS VALUE 'Y'. * : Suppress the New Folder button (ONLY * : works on XP, requires next item too). 10 FILLER PIC X. 88 FOLDERBROWSE-NO-NEW-FOLDER VALUE 'Y'. * * : Use new dialog style which allows * : Resizeable window, allows delete and * : create of folders. Only available on * : Win2k/XP. Ignored on 9x. 10 FILLER PIC X. 88 FOLDERBROWSE-NEWDIALOGSTYLE VALUE 'Y'. * : You may substitute any equivelent * : data areas for these... 01 FOLDERBROWSE-TITLE PIC X(300). 01 FOLDERBROWSE-FOLDERNAME PIC X(1024).