getting Folder Options-> View settings
Hello,
Is there any API using which I can get the the Folder Options for the any folder??
for example: how to retrive whether this is checked or not
Folder Options->View-> Hide extensions for know types
I am avoiding the use of registry as the key values may chage from version to version.
Thanks in advance.
Re: getting Folder Options-> View settings
Yes, there is an API that you can use for this. The API you can use is named SHGetSettings and the Flag you would need to test with this API is named SSF_SHOWEXTENSIONS.
Here is more info :
http://msdn2.microsoft.com/en-us/library/ms647810.aspx
Re: getting Folder Options-> View settings
Thanks a lot
That was working for me...
One little issue. here is how I called the API
Code:
LPSHELLFLAGSTATE lpsfs = new SHELLFLAGSTATE();
SHGetSettings(lpsfs,SSF_SHOWEXTENSIONS);
if(lpsfs->fShowExtensions == FALSE )
{
......
}
delete lpsfs;
but I found that fShowExtensions is not TRUE/FALSE.
instead its value is 0 when checked and -1 when unchecked...
Why it is so??
Thanks again,
Re: getting Folder Options-> View settings
By definition :
FALSE is defined as 0 (zero);
True is defined as NOT FALSE which means "any value not equal zero"!
In your case the value is NOT FALSE (not zero) - means TRUE.
Re: getting Folder Options-> View settings
Hi Victor,
This is what I found in windef.h header file
Code:
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
Also lpsfs->fShowExtensions is of type BOOL.
which is again define as int.
But API should always set the values to TRUE or FALSE.
Isnt it so..?
Re: getting Folder Options-> View settings
Quote:
Originally Posted by sachin871
But API should always set the values to TRUE or FALSE.
Isnt it so..?
No. Not always.
Re: getting Folder Options-> View settings
Ok!
I aggree with u both...
Didnt go throught the documentation properly..
It reads
Quote:
fShowExtensions
Nonzero if the Hide File Extensions for Known File Types option is disabled, or zero otherwise.
:(
Anyways,
Thanks for the help! :thumb: