PathMatchSpec (shlwapi)
Last changed: johnbell149@gmail.com-202.74.138.1

.
Summary
TODO - a short description

C# Signature:

[DllImport("shlwapi.dll", CharSet=CharSet.Auto)]
static extern bool PathMatchSpec([In] String pszFileParam, [In] String pszSpec);

VB Signature:

    Private Declare Auto Function PathMatchSpec Lib "shlwapi" _
    (ByVal pszFileParam As IntPtr, _
    ByVal pszSpec As IntPtr) As IntPtr

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

if(PathMatchSpec("C:\\test.txt", "*.txt"))
{
   // This is text file.
}

VB:

    Private Function MatchSpec(ByVal sFile As String, ByVal sSpec As String) As Boolean

    Dim FilePtr As IntPtr = Marshal.StringToHGlobalAuto(sFile)
    Dim SpecPtr As IntPtr = Marshal.StringToHGlobalAuto(sSpec)
    Dim Match As Boolean

    Match = PathMatchSpec(FilePtr, SpecPtr)

    Marshal.FreeHGlobal(FilePtr)
    Marshal.FreeHGlobal(SpecPtr)

    Return Match

    End Function

Alternative Managed API:

Do you know one? Please contribute it!

Documentation