10.7 Prompting for a File

By using the OF_PROMPT option in the OpenFile function, you can automatically prompt the user to insert the correct disk before reopening a file. OpenFile uses the filename to create a prompt string. If you are reopening a file, you must use the OF_REOPEN and OF_PROMPT options in addition to specifying how you want to open the file:

hFile = OpenFile((LPSTR) NULL, &OfStruct, OF_PROMPT | OF_REOPEN
    | OF_READ);

If you reopen a file as read-only, Windows will check whether the date and time match the date and time the file was first opened.