Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
CompareString (kernel32)
.
C# Signature:
[DllImport("kernel32.dll",CharSet=CharSet.Unicode, SetLastError=true)]
static unsafe extern int CompareStringEx(String strLocale, int flags, String str1, int count1, string str2, int count2, char* version, char* reserved, int param );
[DllImport("kernel32.dll")]
static extern int CompareString(uint Locale, uint dwCmpFlags, string lpString1,
int cchCount1, string lpString2, int cchCount2);
User-Defined Types:
None.
VB Signature:
Public Const LOCALE_NAME_USER_DEFAULT As String = Nothing
<Flags()>
Public Enum EComparationFlags As UInt32
Zero = &H0
NORM_IGNORECASE = &H1 'ignore case
NORM_IGNORENONSPACE = &H2 'ignore nonspacing chars
NORM_IGNORESYMBOLS = &H4 'ignore symbols
LINGUISTIC_IGNORECASE = &H10 'linguistically appropriate 'ignore case'
LINGUISTIC_IGNOREDIACRITIC = &H20 'linguistically appropriate 'ignore nonspace'
NORM_IGNOREKANATYPE = &H10000 'ignore kanatype
NORM_IGNOREWIDTH = &H20000 'ignore width
NORM_LINGUISTIC_CASING = &H8000000 'use linguistic rules for casing
SORT_STRINGSORT = &H1000 'use string sort method
SORT_DIGITSASNUMBERS = &H8 'use digits as numbers sort method
End Enum
Public Enum EComparationResult As Int32
CSTR_LESS_THAN = 1 'string 1 less than string 2
CSTR_EQUAL = 2 'string 1 equal to string 2
CSTR_GREATER_THAN = 3 'string 1 greater than string 2
End Enum
Public Declare Unicode Function CompareStringEx Lib "kernel32" (ByVal strLocaleName As String, ByVal dwComparationFlags As EComparationFlags, ByVal str1 As String, ByVal iLength1 As Int32, ByVal str2 As String, ByVal iLength2 As Int32, ByVal pVersionInformation As IntPtr, ByVal pReserved As IntPtr, ByVal lParam As IntPtr) As EComparationResult
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).