In this section:
FILE_OPENR is used to display the standard Windows 'file open' dialog. It takes a character string argument which is a buffer to receive the file name selected by the user from the dialog. Initially this buffer must be preset to be either blank or have the form '*.abc' otherwise the behaviour of FILE_OPENR is indeterminate. A call-back function should follow the buffer in the argument list. This call-back is called if the user selects a file (as opposed to pressing cancel, etc.).
For example:
EXTERNAL cb
INTEGER cb
CHARACTER*129 str_file
str_file=' '
i=winio@('%^bt[Open file]', 'FILE_OPENR[Open]', str_file, cb)
The value returned to the calling winio@ is the return value of this call-back function, or 1 if no file is selected (so that the underlying window is kept open). By default (if the file name string is initially blank) the file selection box starts by displaying all files from the current directory. However, this and several other default actions of FILE_OPENR can be modified by the prior use of the %fs (Directory for File Dialog) and %ft (Filter for File Dialog) formats or by setting the file name string to the form '*.abc' before the call. For an example of the use of the FILE_OPENR and "+" call-back functions see the description of the %aw (Attach MDI Child Window) format in Attach window. See also %fs and %ft in File selection and filter.