Skip to content

Latest commit

 

History

History
130 lines (99 loc) · 3.79 KB

nf-shlwapi-pathmakeprettya.md

File metadata and controls

130 lines (99 loc) · 3.79 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.PathMakePrettyA
PathMakePrettyA function (shlwapi.h)
Converts an all-uppercase path to all lowercase characters to give the path a consistent appearance. (ANSI)
PathMakePrettyA
shlwapi/PathMakePrettyA
shell\PathMakePretty.htm
shell
fb871054-4c63-42de-b85b-edefa4b09ea0
12/05/2018
PathMakePretty, PathMakePretty function [Windows Shell], PathMakePrettyA, PathMakePrettyW, _win32_PathMakePretty, shell.PathMakePretty, shlwapi/PathMakePretty, shlwapi/PathMakePrettyA, shlwapi/PathMakePrettyW
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
PathMakePrettyW (Unicode) and PathMakePrettyA (ANSI)
Shlwapi.lib
Shlwapi.dll (version 4.71 or later)
Windows
19H1
PathMakePrettyA
shlwapi/PathMakePrettyA
c++
APIRef
kbSyntax
DllExport
Shlwapi.dll
API-MS-Win-shlwapi-Winrt-storage-l1-1-0.dll
api-ms-win-shlwapi-winrt-storage-l1-1-1.dll
PathMakePretty
PathMakePrettyA
PathMakePrettyW

PathMakePrettyA function

-description

Converts an all-uppercase path to all lowercase characters to give the path a consistent appearance.

-parameters

-param pszPath [in, out]

Type: LPTSTR

A pointer to a null-terminated string of length MAX_PATH that contains the path to be converted.

-returns

Type: BOOL

Returns TRUE if the path has been converted, or FALSE otherwise.

-remarks

This function only operates on paths that are entirely uppercase. For example: C:\WINDOWS will be converted to c:\windows, but c:\Windows will not be changed.

Examples

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

void main( void )
{
// Path name 1.
char buffer_1[ ] = "C:\\TEST\\FILE";
char *lpStr1;
lpStr1 = buffer_1;

// Path name 2.
char buffer_2[ ] = "c:\\test\\file";
char *lpStr2;
lpStr2 = buffer_2;

// Test path name 1.
    cout << "The content of the unconverted path is : " << lpStr1 << endl;
    cout << "The \"PathMakePretty\" function returns the value " 
         << PathMakePretty(lpStr1) << "  = TRUE & converts"  << endl;
    cout << "The content of the converted path is   : " << lpStr1 << endl;

// Test path name 2.
    cout << "\nThe content of the unconverted path is : " << lpStr2 << endl;
    cout << "The \"PathMakePretty\" function returns the value " 
         << PathMakePretty(lpStr2) << "  = FALSE & no conversion"  << endl;
    cout << "The content of the converted path is   : " << lpStr2 << endl;
}

OUTPUT:
=============
The content of the unconverted path is : C:\TEST\FILE
The "PathMakePretty" function returns the value 1  = TRUE & converts
The content of the converted path is   : C:\test\file

The content of the unconverted path is : c:\test\file
The "PathMakePretty" function returns the value 0  = FALSE & no conversion
The content of the converted path is   : c:\test\file

Note

The shlwapi.h header defines PathMakePretty as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.