static void test_StrCmpA(void) { static const char str1[] = {'a','b','c','d','e','f'}; static const char str2[] = {'a','B','c','d','e','f'}; ok(0 != StrCmpNA(str1, str2, 6), "StrCmpNA is case-insensitive\n"); ok(0 == StrCmpNIA(str1, str2, 6), "StrCmpNIA is case-sensitive\n"); if (pChrCmpIA) { ok(!pChrCmpIA('a', 'a'), "ChrCmpIA doesn't work at all!\n"); ok(!pChrCmpIA('b', 'B'), "ChrCmpIA is not case-insensitive\n"); ok(pChrCmpIA('a', 'z'), "ChrCmpIA believes that a == z!\n"); } else win_skip("ChrCmpIA() is not available\n"); if (pStrIsIntlEqualA) { ok(pStrIsIntlEqualA(FALSE, str1, str2, 5), "StrIsIntlEqualA(FALSE,...) isn't case-insensitive\n"); ok(!pStrIsIntlEqualA(TRUE, str1, str2, 5), "StrIsIntlEqualA(TRUE,...) isn't case-sensitive\n"); } else win_skip("StrIsIntlEqualA() is not available\n"); if (pIntlStrEqWorkerA) { ok(pIntlStrEqWorkerA(FALSE, str1, str2, 5), "IntlStrEqWorkerA(FALSE,...) isn't case-insensitive\n"); ok(!pIntlStrEqWorkerA(TRUE, str1, str2, 5), "pIntlStrEqWorkerA(TRUE,...) isn't case-sensitive\n"); } else win_skip("IntlStrEqWorkerA() is not available\n"); }
inline int win32_strcmpna(const char * s1, const char * s2, int size) { return StrCmpNA(s1, s2, size); }
/** * Resolves a string to the type of windows control it is. The function only * compares enough letters to determine unequivocally if it matches one of the * supported dialog controls. * * Example: * * CSTRING msgName = "CONNECTEDITDATA"; * oodControl_t ctrl = oodName2controlType(msgName + 7); * * @param name The name to resolve. * * @return The windows control type. winUnknown is returned if there is no * match. * * @remarks There are some generic message names such as getControlDataPage * that need to match to winUnknown. CO is not sufficient to * distinguish between comboBox and control. */ oodControl_t oodName2controlType(CSTRING name) { if ( StrCmpNA(name, "CHECKBOX", 3 ) == 0 ) return winCheckBox; else if ( StrCmpNA(name, "COMBOBOX", 3 ) == 0 ) return winComboBox; else if ( StrCmpNA(name, "DATETIMEPICKER", 1) == 0 ) return winDateTimePicker; else if ( StrCmpNA(name, "EDIT", 1 ) == 0 ) return winEdit; else if ( StrCmpNA(name, "GROUPBOX", 1 ) == 0 ) return winGroupBox; else if ( StrCmpNA(name, "LISTBOX", 5 ) == 0 ) return winListBox; else if ( StrCmpNA(name, "LISTVIEW", 5 ) == 0 ) return winListView; else if ( StrCmpNA(name, "MONTHCALENDAR", 1 ) == 0 ) return winMonthCalendar; else if ( StrCmpNA(name, "PROGRESSBAR", 2 ) == 0 ) return winProgressBar; else if ( StrCmpNA(name, "PUSHBUTTON", 2 ) == 0 ) return winPushButton; else if ( StrCmpNA(name, "RADIOBUTTON", 1 ) == 0 ) return winRadioButton; else if ( StrCmpNA(name, "SCROLLBAR", 2 ) == 0 ) return winScrollBar; else if ( StrCmpNA(name, "STATIC", 2 ) == 0 ) return winStatic; else if ( StrCmpNA(name, "TAB", 3 ) == 0 ) return winTab; else if ( StrCmpNA(name, "TRACKBAR", 3 ) == 0 ) return winTrackBar; else if ( StrCmpNA(name, "TREEVIEW", 3 ) == 0 ) return winTreeView; else if ( StrCmpNA(name, "UPDOWN", 1 ) == 0 ) return winUpDown; else return winUnknown; }