angusj 126 Posted January 30, 2023 (edited) I recently received an email informing me that not all files were appearing in a FileOpen dialog in one of my applications**. And this dialog had absolutely no filtering applied (at least when selecting *.* 😜). The folder given as an example was: C:\Windows\System32\fr-FR And I too wasn't seeing all the files in this folder. Using Delphi 10.4 Update 2 ... I first tried a completely new VCL application with just a TOpenDialog control (without success). I then tried a bare bones console application that's a Delphi translation of this C++ code: https://learn.microsoft.com/en-us/windows/win32/learnwin32/example--the-open-dialog-box program Project2; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils, ActiveX, ShlObj; var hr: HRESULT; fileOpen: IFileOpenDialog; item: IShellItem; path: LPWSTR; begin hr := CoInitializeEx(nil, COINIT_APARTMENTTHREADED or COINIT_DISABLE_OLE1DDE); if (SUCCEEDED(hr)) then begin // Create the FileOpenDialog object. hr := CoCreateInstance(CLSID_FileOpenDialog, nil, CLSCTX_ALL, IID_IFileOpenDialog, fileOpen); if (SUCCEEDED(hr)) then begin // Show the Open dialog box. hr := fileOpen.Show(0); // Get the file name from the dialog box. if (SUCCEEDED(hr)) then begin hr := fileOpen.GetResult(item); if (SUCCEEDED(hr)) then begin hr := item.GetDisplayName(SIGDN_FILESYSPATH, path); // Display the file name to the user. if (SUCCEEDED(hr)) then begin MessageBoxW(0, path, 'the path', MB_OK); CoTaskMemFree(path); end; //item._Release; end; end; //fileOpen._Release; end; CoUninitialize(); end; end. And this problem persists with only about half the files in the folder (mentioned above) being displayed. However, when I compile the C++ code from the link above in MSVC, the console app. does show all the files (as expected). Any suggestions? **Resource Hacker Edited January 30, 2023 by angusj Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 (edited) Reproduced. Not only does the file open dialog not show all files. It refuses to accept the names of the files it doesn't show. I have reproduced with both Delphi applications ** and notepad++ (which presumably isn't written in Delphi). Notepad.exe can see the files. Intriguing... **) Resource Editor 🙂 Edited January 30, 2023 by Anders Melander Share this post Link to post
Lars Fosdal 1792 Posted January 30, 2023 Are there any special attributes on the files not listed? Share this post Link to post
angusj 126 Posted January 30, 2023 1 minute ago, Lars Fosdal said: Are there any special attributes on the files not listed? No. (That was the very first thing I checked.) Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 Ah!... Have a look at C:\Windows\SysWOW64\fr-FR instead See it now? Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 https://learn.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector 1 Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 8 minutes ago, Lars Fosdal said: Wow, that IS weird. WOW, indeed 🙂 Your subconsciousness at work. 2 Share this post Link to post
Virgo 18 Posted January 30, 2023 32 bit programs show contents of C:\Windows\SYSWOW64, when looking at C:\Windows\SYSTEM32. 64 bit programs show contents of C:\Windows\SYSTEM32, when looking at C:\Windows\SYSTEM32. Basic 64 bit Windows thing. Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 2 minutes ago, Virgo said: 32 bit programs show [...rewrite of what was just posted...] Basic 64 bit Windows thing. ChatGPT, is that you? Okay, now I've had too much coffee. Share this post Link to post
angusj 126 Posted January 30, 2023 (edited) 23 hours ago, Anders Melander said: https://learn.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector Well done finding that. But I still don't understand why the different compilers show different folder content when it's virtually the same code. Edit: Arh, it's the application's 32bit vs 64bit (not the OS). Sorry, a bit slow tonight. Edited January 31, 2023 by angusj Share this post Link to post
Virgo 18 Posted January 30, 2023 And I managed to miss, that Anders Melander had already posted link to explanation.... Share this post Link to post
Anders Melander 1782 Posted January 30, 2023 2 minutes ago, angusj said: But I still don't understand why the different compilers show different folder content when it's virtually the same code. One compiles a 32-bit application, the other a 64-bit. Share this post Link to post
Fr0sT.Brutal 900 Posted January 30, 2023 Just curious. What did they do in system folder? Share this post Link to post
Remy Lebeau 1393 Posted January 30, 2023 4 hours ago, Fr0sT.Brutal said: Just curious. What did they do in system folder? What do you mean? Share this post Link to post
Fr0sT.Brutal 900 Posted January 31, 2023 (edited) 13 hours ago, Remy Lebeau said: What do you mean? What were users trying to find in that system folder? I personally can't tell when I was visiting Windows\System last time. The mentioned folder contains translated resources for system apps, as I understood. That's why the question. Edited January 31, 2023 by Fr0sT.Brutal Share this post Link to post
angusj 126 Posted January 31, 2023 (edited) 6 hours ago, Fr0sT.Brutal said: What were users trying to find in that system folder? I did ask because I was also curious. And a very brief part of the reply was that this user has written an add-on for anther program and states that "I want, eventually, to support multiple languages in the UI". I've really no idea how he plans to do that, and how accessing these files will help. Nevertheless in the past I have used Resource Hacker to glean dialog control ids, menus etc which I've altered dynamically from my own applications (via Windows' messaging system). And on rare occasions I've even altered application resources (modified the files) to better suit my needs - change a menu shortcut, enable a menu item, it tweak a dialog. Edited January 31, 2023 by angusj Share this post Link to post
Fr0sT.Brutal 900 Posted January 31, 2023 BTW, is that you an original author? I've been using old-style version of ResHacker since, maybe, mid-00s! Share this post Link to post
Attila Kovacs 629 Posted January 31, 2023 (edited) I still have a 3.4.0.79 from 2002 on my desktop PC Edited January 31, 2023 by Attila Kovacs Share this post Link to post
angusj 126 Posted January 31, 2023 (edited) 1 hour ago, Fr0sT.Brutal said: BTW, is that you an original author? Yep, the only author 😁. Edited January 31, 2023 by angusj Share this post Link to post
timfrost 78 Posted February 1, 2023 How do I have version 5.1.8.360 installed when your own link above is only to 5.1.7 ? Share this post Link to post
Nigel Thomas 35 Posted February 2, 2023 12 hours ago, timfrost said: How do I have version 5.1.8.360 installed when your own link above is only to 5.1.7 ? Don't believe the version number stated on Angus's website, the version downloadable from there is 5.1.8.360. Share this post Link to post