Home All Groups Group Topic Archive Search About

Maybe a dumb user q - How do you find out the path to the user

Author
22 Feb 2007 1:39 AM
Lorne Steiner
Maybe a dumb user question, however...how do you find out the path to the
user folder, is it an API call? Also will this work under both XP and Vista.

Thanks in Advance
Lorne Steiner
** definately NOT an MVP <g>

Author
22 Feb 2007 9:18 AM
Jan Hyde
"Lorne Steiner" <lorne_stei***@hotmail.com>'s wild thoughts
were released on Wed, 21 Feb 2007 17:39:50 -0800 bearing the
following fruit:

>Maybe a dumb user question, however...how do you find out the path to the
>user folder, is it an API call? Also will this work under both XP and Vista.
>
>Thanks in Advance
>Lorne Steiner
>** definately NOT an MVP <g>

You want to call the function with CSIDL_PROFILE

Yes it works under both XP and Vists

--------- Start code ------------


Private Declare Function SHGetPathFromIDList Lib
"shell32.dll" _
    Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _
    ByVal pszPath As String) As Long

Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal pv
As Long)

Private Declare Function SHGetSpecialFolderLocation Lib
"shell32.dll" _
   (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As
Long) As Long

Private Const NOERROR = 0
Private Const CSIDL_PROGRAMS = &H2
Private Const CSIDL_PERSONAL = &H5
Private Const CSIDL_PROFILE = &H28

Private Function GetSpecialFolder(CSIDL As Long) As String

  Dim buffer As String
  Dim pidl As Long


  If SHGetSpecialFolderLocation(GetDesktopWindow, CSIDL,
pidl) = NOERROR Then

      buffer = Space$(260)

      If SHGetPathFromIDList(ByVal pidl, ByVal buffer) Then
         GetSpecialFolder = Left$(buffer, InStr(buffer,
Chr(0)) - 1)
         Call CoTaskMemFree(pidl)
      End If

    End If

End Function

--------- End code ------------

Jan Hyde (VB MVP)

--
A man turned up at our local jail and claimed to be a painter.
He offered to do portraits of all the inmates. He was obviously a con artist.

(Jonathan Delaney)
Author
22 Feb 2007 8:25 PM
Robert Morley
> ** definately NOT an MVP <g>

And at the risk of getting utterly off-topic...

    definately not good at spelling "definitely", either. <g>


Rob
Author
22 Feb 2007 9:59 PM
Jim Carlock
"Lorne Steiner" asked...
: Maybe a dumb user question, however...how do you find out the
: path to the user folder, is it an API call? Also will this work under
: both XP and Vista.

I take it the reply in the other message group about %userprofile%
answered your question about the user path.

I have a question to ask back at you... Your newsreading app
reports the following information in your posts:

X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6000.16386
X-MIMEOLE: Produced By Microsoft MimeOLE V6.0.6000.16386

What exactly is "Microsoft Windows Mail 6.0.6000.16386"?

Do you access the websites through your Internet Browser or
is Microsoft replacing Outlook Express? If you don't know
the answer to the question, could you tell us how you access
the newsgroup and through which link/URI?

--
Jim Carlock
Post replies to the group.
Author
22 Feb 2007 10:18 PM
Karl E. Peterson
Jim Carlock <anonymous@localhost> wrote:
> What exactly is "Microsoft Windows Mail 6.0.6000.16386"?
>
> Do you access the websites through your Internet Browser or
> is Microsoft replacing Outlook Express?

I'm not sure, but could that be the replacement (yes, it's true) for OE in Vista?
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
23 Feb 2007 12:37 AM
Kevin Provance
Karl,

According to a few of my customers who insist on using Vista, that answer
would be a resounding "yes".

::sigh::

- Kev

Show quoteHide quote
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:OzJvl9sVHHA.4872@TK2MSFTNGP03.phx.gbl...
| Jim Carlock <anonymous@localhost> wrote:
| > What exactly is "Microsoft Windows Mail 6.0.6000.16386"?
| >
| > Do you access the websites through your Internet Browser or
| > is Microsoft replacing Outlook Express?
|
| I'm not sure, but could that be the replacement (yes, it's true) for OE in
Vista?
| --
| .NET: It's About Trust!
| http://vfred.mvps.org
|
|
Author
23 Feb 2007 1:43 PM
Jan Hyde
"Jim Carlock" <anonymous@localhost>'s wild thoughts were
released on Thu, 22 Feb 2007 16:59:25 -0500 bearing the
following fruit:

Show quoteHide quote
>"Lorne Steiner" asked...
>: Maybe a dumb user question, however...how do you find out the
>: path to the user folder, is it an API call? Also will this work under
>: both XP and Vista.
>
>I take it the reply in the other message group about %userprofile%
>answered your question about the user path.
>
>I have a question to ask back at you... Your newsreading app
>reports the following information in your posts:
>
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Windows Mail 6.0.6000.16386
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.0.6000.16386
>
>What exactly is "Microsoft Windows Mail 6.0.6000.16386"?
>
>Do you access the websites through your Internet Browser or
>is Microsoft replacing Outlook Express? If you don't know
>the answer to the question, could you tell us how you access
>the newsgroup and through which link/URI?

OE no longer exist in Vista - Windows Mail is the
replacement.
Author
23 Feb 2007 1:46 PM
David Kerber
In article <krrtt21dg4o6vcaulv4vlekj7ksl6ki***@4ax.com>,
StellaDrin***@REMOVE.ME.uboot.com says...
Show quoteHide quote
> "Jim Carlock" <anonymous@localhost>'s wild thoughts were
> released on Thu, 22 Feb 2007 16:59:25 -0500 bearing the
> following fruit:
>
> >"Lorne Steiner" asked...
> >: Maybe a dumb user question, however...how do you find out the
> >: path to the user folder, is it an API call? Also will this work under
> >: both XP and Vista.
> >
> >I take it the reply in the other message group about %userprofile%
> >answered your question about the user path.
> >
> >I have a question to ask back at you... Your newsreading app
> >reports the following information in your posts:
> >
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Windows Mail 6.0.6000.16386
> >X-MIMEOLE: Produced By Microsoft MimeOLE V6.0.6000.16386
> >
> >What exactly is "Microsoft Windows Mail 6.0.6000.16386"?
> >
> >Do you access the websites through your Internet Browser or
> >is Microsoft replacing Outlook Express? If you don't know
> >the answer to the question, could you tell us how you access
> >the newsgroup and through which link/URI?
>
> OE no longer exist in Vista - Windows Mail is the
> replacement.

You could probably install it if you want, though.


--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).