Closed nyanpasu64 closed 2 years ago
AfxResolveShortcut is sufficient to reproduce the bug even with no file being opened.
ProcessShellCommand indirectly calls SHGetFileInfo.
turns out calling SHGetFileInfo (SHGetFileInfoA) on existing .0cc files within your user directory (didn't test non-.0cc files) causes the file dialog to break.
no breakage when calling it on existing .0cc files in C:\ (didn't test other users), or non-existent .0cc files within your user profile.
also this bug dates back to ft 0.4.6, but not mspaint or wordpad (first party microsoft mfc apps).
i ran procmon on this single function call. i did notice SHGetFileInfoA accessed a lot of registry HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions{guid}...
procmon records the call stack, it's SHGetFileInfoA -> SHGetFileInfoW -> SHParseDisplayName.
what happens when i function-breakpoint that name in visual studio?
are you supposed to call ProcessShellCommand within InitInstance? i assume so, microsoft says to.
RegOverridePredefKey is called because, uhh... something about windows vista.
if the first call to SHGetFileInfo occurs after the call to RegOverridePredefKey, but before the app finishes loading and the user opens a file dialog, then all file dialogs are fucked up.
a shitty workaround is to call SHGetFileInfo (or SHParseDisplayName?) before calling RegOverridePredefKey.
I used to see this, no longer see it.
On my machine, if you call the dn-ft .exe and pass in a .0cc or .ftm file, then the Open dialog is missing "This PC".
This occurs regardless if you call it by a 8.3 .exe name or a long path, through either a file association or in a console. (Dn-FT sets itself as a file handler for .0cc files, using a 8.3 path for the EXE, but the module is passed in as a long path. This is not the bug.) It does not occur if you call
Dn-FamiTracker.exe -console
(a command line argument that's not a file to open).