PathIsSameRoot (shlwapi)
Last changed: pdellera-24.5.99.244

.
Summary
Compares two paths to determine if they have a common root component.

C# Signature:

[DllImport("shlwapi.dll", CharSet=CharSet.Auto)]
static extern bool PathIsSameRoot([In] String pszPath1, [In] String pszPath2);

VB Signature:

Declare Function PathIsSameRoot Lib "shlwapi.dll" (TODO) As TODO

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

bool bRet;
bRet = PathIsSameRoot(@"C:\path1\one", @"C:\path2\two");
// Result: bRet == true
bRet = PathIsSameRoot(@"C:\path1\one", @"E:\acme\three");
// Result: bRet == false

Alternative Managed API:

Do you know one? Please contribute it!

Documentation