In a VC++ project, I have a combobox with dropdown style. During program initialisation, I fill the list of strings from a file, and set the edit of the combo box to a string which I read from registry. However the outcome is not always what I want it to be. Whenever the text which I write to the edit starts with something that is contained in the list, the string from the list is copied to the edit. For example: The list contains the string "UserAdmin", and I do
SendMessage(hwndCombo, WM_SETTEXT, 0, (LPARAM)"UserA");
then the combo edit will show "UserAdmin" (but I want it to show "UserA"). However, if I do
SendMessage(hwndCombo, WM_SETTEXT, 0, (LPARAM)"UserAb");
the combo edit will show "UserAb" as expected. I wonder what I may be doing wrong.
For those who wonder why I don't use CComboBox: This is a function which receives the handle through its parameter list.
Thanks... Hans