The initdir parameter in GetFileOpenName function uses some different algorithms in
Windows 2000/XP/Vista from Windows
7.
Windows 2000/Windows XP/Windows Vista:
- If filename contains a path, that path is the initial directory.
- Otherwise, initdir specifies the initial directory.
- If the application has used an Open or Save As dialog box in the past, the path
most recently used is selected as the initial directory. However, if an
application is not run for a long time, its saved path is discarded.
- If initdir is NULL and the current directory contains any
files of the specified filter types, the initial directory is the current
directory.
- Otherwise, the initial directory is the personal files directory of the current
user.
- If no other conditions are met, the initial directory is the Desktop
folder.
Windows 7:
- If initdir has the same value that was selected in the first
instance of the application's Open or Save As dialog box, then it uses the path
the user selected most recently as the initial directory.
- If filename contains a path, that path is the initial directory.
- If initdir is not NULL, it specifies the initial
directory.
- If initdir is NULL and the current directory contains any
files of the specified filter types, the initial directory is the current
directory.
- Otherwise, the initial directory is the personal files directory of the current
user.
- If no other conditions are met, the initial directory is the Desktop
folder.