#pragma hdrstop
#endif
-#if wxUSE_CHOICE && !defined(__SMARTPHONE__)
+#if wxUSE_CHOICE && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
#ifndef WX_PRECOMP
#include "wx/choice.h"
return wxNOT_FOUND;
#else // !Watcom
- int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
- (WPARAM)-1, (LPARAM)s.c_str());
-
- return pos == LB_ERR ? wxNOT_FOUND : pos;
+ //TODO: Evidently some MSW versions (all?) don't like empty strings
+ //passed to SendMessage, so we have to do it ourselves in that case
+ if ( s.size() == 0 )
+ {
+ int count = GetCount();
+ for ( int i = 0; i < count; i++ )
+ {
+ if ( GetString(i).size() == 0 )
+ return i;
+ }
+
+ return wxNOT_FOUND;
+ }
+ else
+ {
+ int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT,
+ (WPARAM)-1, (LPARAM)s.c_str());
+
+ return pos == LB_ERR ? wxNOT_FOUND : pos;
+ }
#endif // Watcom/!Watcom
}
return (WXHBRUSH)brush->GetResourceHandle();
}
-#endif // wxUSE_CHOICE && !__SMARTPHONE__
+#endif // wxUSE_CHOICE && !(__SMARTPHONE__ && __WXWINCE__)