From: Larry on
Hi,

I was searching a place in the windows filesystem to save a preference
file. I have found out that onmy system (vista) that place is supposed to
be:

Pref: \Users\MY_ACCOUNT\AppData\Local

Also, I'd like to know if the following is the correct path to a %temp%
directory to save some file for the running session to be delete at the end
of the session:

Temp: \Users\MY_ACCOUNT\AppData\Local\Temp

Do you think I could retrieve those paths with some API function?

thanks

From: ScottMcP [MVP] on
On Feb 2, 6:03 am, "Larry" <dontmewit...(a)got.it> wrote:
> Do you think I could retrieve those paths with some API function?
>
> thanks

Retrieve those paths with SHGetFolderPath(...);

It is important to use this because the paths are different on each
version of the operating system.

From: Larry on
"ScottMcP [MVP]" <scottmcp(a)mvps.org> ha scritto nel messaggio
news:60365dc4-4c92-48f9-b6aa-c182f84cb6f2(a)p6g2000vbl.googlegroups.com...

> Retrieve those paths with SHGetFolderPath(...);

Ok! Yet, I think I'll use SHGetKnownFolderPath() alogn with KNOWNFOLDERID
since SHGetFolderPath() seems to be deprecated.

Thanks

From: Nathan Mates on
In article <4b686598$0$1145$4fafbaef(a)reader1.news.tin.it>,
Larry <dontmewithme(a)got.it> wrote:
>"ScottMcP [MVP]" <scottmcp(a)mvps.org> ha scritto nel messaggio
>news:60365dc4-4c92-48f9-b6aa-c182f84cb6f2(a)p6g2000vbl.googlegroups.com...

>> Retrieve those paths with SHGetFolderPath(...);

>Ok! Yet, I think I'll use SHGetKnownFolderPath() alogn with KNOWNFOLDERID
>since SHGetFolderPath() seems to be deprecated.

Well, SHGetKnownFolderPath() requires Vista and up, according to
http://msdn.microsoft.com/en-us/library/bb762188%28VS.85%29.aspx . If
you're comfortable doing that, fine. However, if you want to support
XP, you'll need to use SHGetFolderPath, which works fine on both XP
and Vista.

Frankly, I can't see what was so broken with SHGetFolderPath that
required its deprecation and replacement by something that seems
pretty much the same. Yes, SHGetKnownFolderPath seems to support a few
more folder types, but SHGetFolderPath had various CLSIDs added to it
over the years.

Nathan Mates

--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein