Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- M E W E L - <b>int openfile(byte *lpfilename, pofstruct lpreopenbuff, word wstyle)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
int  OpenFile(BYTE *lpFileName, POFSTRUCT lpReOpenBuff, WORd wStyle)
  This function creates, opens, reopens, or deletes a file.

Parameters
  lpFileName - Points to a null-terminated character string that names the
                file to be opened. The lpFileName parameter cannot contain
                wildcard characters.

  lpReOpenBuff - Points to the OFSTRUCT data structure that is to receive
                information about the file when the file is first opened.
                The structure can be used in subsequent calls to the
                OpenFile function to refer to the open file.

  wStyle - Specifies the action to take. These styles can be combined by
                using the bitwise OR operator:


                OF_CANCEL - Adds a Cancel button to the OF_PROMPT dialog box.
                            Pressing the Cancel button directs OpenFile to
                            return a file-not-found error message.

                OF_CREATE - Directs OpenFile to create a new file. If the
                            file already exists, it is truncated to zero
                            length.

                OF_DELETE - Deletes the file.

                OF_EXIST  - Opens the file, and then closes it. Used to test
                            for file existence.

                OF_PARSE  - Fills the OFSTRUCT data structure but carries
                            out no other action.

                OF_PROMPT - Displays a dialog box if the requested file does
                            not exist.

                OF_READ   - Opens the file for reading only.

                OF_READWRITE - Opens the file for reading and writing.

                OF_WRITE  - Opens the file for writing only.

Returns
 The return value specifies a DOS file handle if the function is successful.
Otherwise, it is -1.

Comments
 If the file is not found in the current directory , OpenFIle() will search
for the file in the directory where the MEWEL application was run from,
and along the directories specified in the PATH environment variable.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson