On Sat, 14 Apr 2007, Mattias Sjögren wrote:
I'm not sure you can call it a ".NET way", but there's a native API to
retrieve these settings called SHGetSettings (use the
SSF_SHOWEXTENSIONS flag).
That sounds like a better way than reading the Registry. And probably
much less hassle than IShellDispatch4::GetSetting.
I see the SHELLFLAGSTATE struct that SHGetSettings uses is a 16-bit
group of bitfields. You can't do bitfields in C# / PInvoke, can you? I
would need to declare SHGetSettings with its first parameter as "out
UInt16" and do bitwise operations on the value, yes? Like so:
UInt16 u;
SHGetSettings( out u, SSF_SHOWEXTENSIONS );
bool bShowExt = ( ( u & 0x0002 ) != 0 );