Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Win 2 API - <b>openfile</b> open, reopen, create or delete a file http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
OpenFile             Open, Reopen, Create Or Delete A File

int OpenFile(lpFilename, lpReOpenBuff, wStyle)
LPSTR lpFilename;
LPOFSTRUCT lpReOpenBuff;
WORD wStyle;

                        wStyle
        |-------------------------------------------------|
        | OF_CANCEL    Add cancel button to OF_PROMPT box |
        | OF_CREATE    Create new file, truncate existing |
        | OF_DELETE    Delete file                        |
        | OF_EXIST     Open then close file, test exists  |
        | OF_PARSE     Fill OFSTRUCT, no other action     |
        | OF_PROMPT    Prompt for creation if not found   |
        | OF_READ      Read only                          |
        | OF_READWRITE Read/Write                         |
        | OF_REOPEN    Open based on info in OFSTRUCT     |
        | OF_VERIFY    Verify timestamp hasn't changed    |
        | OF_WRITE     Write only                         |
        +-------------------------------------------------+

Returns:    Handle to file or -1 if error.

Note:           Wildcard characters in filename will use search PATH
                for first matching file.

                Use Normal DOS read, write, lseek functions.

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