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 shlwapi, prefix the name with the module name and a period.
''' <summary>
''' Removes the path portion of a fully qualified path and file.
''' </summary>
''' <param name="pszPath">A pointer to a null-terminated string of length MAX_PATH that contains the path and file name. When this function returns successfully, the string contains only the file name, with the path removed.</param>
<DllImport("shlwapi.dll", EntryPoint:="PathStripPathW", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Sub PathStripPath(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder)
End Sub
VB Signature:
Public Declare Sub PathStripPath Lib "shlwapi" Alias "PathStripPathA" _
(ByVal pszPath As String)
Declare Function PathStripPath Lib "shlwapi.dll" (TODO) As TODO
Notes:
This is similar, but not identical, to Path.GetFileName. If the input string ends with a directory, the directory is returned rather than nothing; for example, "C:\foo\" becomes "foo\", "C:" stays "C:".
Dim strFile As New system.Text.StringBuilder(255)
strFile.Append("c:\abc\def\words.doc")
Win32.API.Shlwapi.PathStripPath(strFile)
System.Diagnostics.Debug.WriteLine(strFile.ToString())
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).