PathStripToRootPathStripToRoot*
*Contents  *Index  *Topic Contents
*Previous Topic: PathStripPath
*Next Topic: PathUnmakeSystemFolder

PathStripToRoot


BOOL PathStripToRoot(
    LPTSTR szRoot
    );

Removes all parts of the path except for the root information.

szRoot
Address of the path to be converted.

Example:

#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main( void )
{

    // Path to convert.
	char buffer_1[] = "C:\\path1\\path2";
	char *lpStr1;
	lpStr1 = buffer_1;

	// Print the path before the root is stripped.
    cout << "The contents of the path before is :      " << lpStr1 << endl;

	// Print the return value from the function.
	cout << "The return from \"PathStripToRoot\" is :  "
		 << PathStripToRoot(lpStr1) << endl;

	// Print the path before the root is stripped.
	cout << "The contents of the path after is :       " << lpStr1 << endl;
}
OUTPUT:
==================
The path before is :      C:\path1\path2
The return from "PathStripToRoot" is :  1
The path after is :       C:\

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.