Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shell32, prefix the name with the module name and a period.
SHGetFolderPath (shell32)
.
C# Signature:
[DllImport("shell32.dll")]
static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken,
uint dwFlags, [Out] StringBuilder pszPath);
VB.Net Signature:
<DllImport("shell32.dll")> _
Private Shared Function SHGetFolderPath(ByVal hwndOwner As IntPtr, ByVal nFolder As Int32, ByVal hToken As IntPtr, ByVal dwFlags As Int32, ByVal pszPath As StringBuilder) As Int32
End Function
User-Defined Types:
Private Const CSIDL_WINDOWS As Integer = &H24
Sample Code:
Dim winPath As New StringBuilder(300)
If SHGetFolderPath(Nothing, CSIDL_WINDOWS, Nothing, 0, winPath) <> 0 Then
Throw New ApplicationException("Can't get window's directory")
End If
Console.WriteLine(winPath.ToString)
Alternative Managed API:
Do you know one? Please contribute it!
The SHGetFolderPath API
1/17/2013 11:06:46 PM - -24.39.41.252
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).