[DllImport("shlwapi.dll", CharSet=CharSet.Auto)]
static extern Int32 PathCommonPrefix(
[In] String pszFile1,
[In] String pszFile2,
[Out] StringBuilder pszPath
);
Declare Function PathCommonPrefix Lib "shlwapi.dll" (TODO) As TODO
None.
pszPath may be null, but must have a capacity of at least MAX_PATH - 1 if supplied. The return value is the length of the common prefix.
Please add some!
StringBuilder str = new StringBuilder(MAX_PATH);
Int32 nRet = PathCommonPrefix(
@"C:\win\desktop\temp.txt",
@"c:\win\tray\sample.txt",
str
);
// Result: nRet == 6 && str.ToString() == @"C:\win"
Do you know one? Please contribute it!