|
-
August 6th, 2007, 05:59 AM
#1
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.
-
August 6th, 2007, 06:38 AM
#2
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
Last edited by HanneSThEGreaT; August 6th, 2007 at 06:40 AM.
Reason: More Info
-
August 6th, 2007, 07:20 AM
#3
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,
-
August 6th, 2007, 07:38 AM
#4
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.
Victor Nijegorodov
-
August 6th, 2007, 08:00 AM
#5
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..?
-
August 6th, 2007, 08:04 AM
#6
Re: getting Folder Options-> View settings
 Originally Posted by sachin871
But API should always set the values to TRUE or FALSE.
Isnt it so..?
No. Not always.
-
August 6th, 2007, 08:07 AM
#7
Re: getting Folder Options-> View settings
Ok!
I aggree with u both...
Didnt go throught the documentation properly..
It reads
fShowExtensions
Nonzero if the Hide File Extensions for Known File Types option is disabled, or zero otherwise.
Anyways,
Thanks for the help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|