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.
PathRemoveExtension (shlwapi)
.
C# Signature:
/// <summary>
/// Removes the file name extension from a path, if one is present.
/// </summary>
/// <param name="pszFile">A pointer to a null-terminated string of length MAX_PATH from which to remove the extension.</param>
[DllImport("shlwapi.dll", EntryPoint = "PathRemoveExtensionW", SetLastError = True, CharSet= CharSet.Unicode)]
static extern void PathRemoveExtension([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder pszFile);
VB.NET Extension
''' <summary>
''' Removes the file name extension from a path, if one is present.
''' </summary>
''' <param name="pszFile">A pointer to a null-terminated string of length MAX_PATH from which to remove the extension.</param>
<DllImport("shlwapi.dll", EntryPoint:="PathRemoveExtensionW", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Sub PathRemoveExtension(<MarshalAs(UnmanagedType.LPTStr)>pszFile As System.Text.StringBuilder)
End Sub
VB Signature:
Public Declare Sub PathRemoveExtension Lib "shlwapi" Alias "PathRemoveExtensionA" _
(ByVal pszPath As String)
User-Defined Types:
None.
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
Dim strFile As New system.Text.StringBuilder(255)
strFile.Append("c:\abc\def\words.doc")
Win32.API.Shlwapi.PathRemoveExtension(strFile)
System.Diagnostics.Debug.WriteLine(strFile.ToString())
PathRemoveExtension - Removes the file name extension from a path, if one is present.
2/7/2012 11:00:22 PM - anonymous
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).