1

I'm using Microsoft.WindowsAPICodePack to do folder selection from a CommonOpenFileDialog.

This is a windows forms application.

This is what it looks like in both cases

As soon as I open the file dialog my main window's style appears to be stripped off and it loses its icon.

Is there a way to prevent this? What exactly is happening?

I'm using Visual Studio 2017 C#.

Pankwood
  • 1,799
  • 5
  • 24
  • 43
Lokiare
  • 1,238
  • 1
  • 15
  • 23
  • This is not normal of course. These shell dialogs are a bit notorious, they inject a large number of DLLs into your process. Shell extensions, the same ones you use in Explorer. You probably have a bad one that messes with the window(s) in your process too much. Not uncommon, programmers tend to have a lot of them and they are not always of the best quality. Consider using SysInternals' AutoRuns utility, it lets you disable these extensions selectively so you can find the bad one. – Hans Passant Aug 10 '18 at 17:34
  • I'm using the Microsoft.WindowsAPICodePack from Microsoft. Not sure why they'd use injection and other things like that when they have access to the native source code. – Lokiare Aug 10 '18 at 17:44
  • Sounds like you don't understand how shell extensions work. Well, it is fairly obscure. You can see them, use Project > Properties > Debug, tick the "Enable native code debugging" checkbox. Run your project and look at the Output window for the DLLs that get loaded at the exact moment you display the dialog. Usually rather a lot of them, one of them is the evildoer. – Hans Passant Aug 10 '18 at 17:49
  • Is there a way to block them and will it still work? – Lokiare Aug 10 '18 at 17:53

0 Answers0