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>
''' Searches a string using a Microsoft MS-DOS wildcard match type.
''' </summary>
''' <param name="pszFile">A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be searched.</param>
''' <param name="pszSpec">A pointer to a null-terminated string of maximum length MAX_PATH that contains the file type for which to search. For example, to test whether pszFile is a .doc file, pszSpec should be set to "*.doc".</param>
''' <returns>Returns TRUE if the string matches, or FALSE otherwise.</returns>
<DllImport("shlwapi.dll", EntryPoint:="PathMatchSpecW", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Function PathMatchSpec(<MarshalAs(UnmanagedType.LPTStr)>pszFile As String, _
<MarshalAs(UnmanagedType.LPTStr)>pszSpec As String) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
static extern bool PathMatchSpec([In] String pszFileParam, [In] String pszSpec);
VB Signature:
Private Declare Auto Function PathMatchSpec Lib "shlwapi" _
(ByVal pszFileParam As String, _
ByVal pszSpec As String) As Boolean
User-Defined Types:
None.
Notes:
None.
Tips & Tricks:
Please add some!
Sample Code:
C# Example
if(PathMatchSpec("C:\\test.txt", "*.txt"))
{
// This is text file.
}
VB.NET Example
Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean
Return PathMatchSpec(sFile, sSpec)
VB:
Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean
End Function
Return PathMatchSpec(sFile, sSpec)
VB Example
Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean
End Function
MatchSpec = PathMatchSpec(sFile, sSpec)
End Function
Alternative Managed API:
Do you know one? Please contribute it!
PathMatchSpec - Searches a string using a Microsoft MS-DOS wildcard match type.
1/19/2016 11:47:03 AM - johnbell149@gmail.com-202.74.138.1
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).