Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
String Functions
 StrCmpLogicalW Function

  Switch on low bandwidth view
StrCmpLogicalW Function

Compares two Unicode strings. Digits in the strings are considered as numerical content rather than text. This test is not case-sensitive.

Syntax

int StrCmpLogicalW(      
    LPCWSTR psz1,     LPCWSTR psz2 );

Parameters

psz1
[in] A pointer to the first null-terminated string to be compared.
psz2
[in] A pointer to the second null-terminated string to be compared.

Return Value

  • Returns zero if the strings are identical.
  • Returns 1 if the string pointed to by psz1 has a greater value than that pointed to by psz2.
  • Returns -1 if the string pointed to by psz1 has a lesser value than that pointed to by psz2.

Remarks

This function's ordering schema differs somewhat from StrCmpI, which also compares strings without regard to case sensitivity. Considering digits by their numerical value—as StrCmpLogicalW does—strings are ordered as follows:

2string
3string
20string
st2ring
st3ring
st20ring
string2
string3
string20
StrCmpI considers digits in the string only as text so that those same strings are ordered as follows:
20string
2string
3string
st20ring
st2ring
st3ring
string2
string20
string3
Note  Behavior of this function, and therefore the results it returns, can change from release to release. It should not be used for canonical sorting applications.

Function Information

Minimum DLL VersionShlwapi.dll version 5.5 or later
Custom ImplementationNo
HeaderShlwapi.h
Import libraryshlwapi.lib
Minimum operating systems Windows XP
UnicodeImplemented as Unicode version.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker