From
GetModuleFileName()[
^] in the MSDN:
Quote:
The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\".
So it should be like on your disk when double clicking the file in the Explorer and as typed when using the command shell to start the program.
Another cite:
Quote:
If a DLL is loaded in two processes, its file name in one process may differ in case from its file name in the other process.
While this applies to DLL's it indicates that the case it not always the same.
So you should accept the behaviour and optionally get the real name from the disk using
FindFirstFile()
.