deselect text in combo box
I have created a combo box like this :
Code:
combo_hwnd = CreateWindowEx(WS_EX_WINDOWEDGE, "COMBOBOX" , NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWN , left, top, width , height , parent_hwnd, NULL, NULL, NULL);
When I select an item from a drop down list, its text appears normally in the edit part, but it always appears as selected text. I want to deselect this text, and I tried to achieve that by sending CB_SETEDITSEL message, right after item selection:
Code:
case WM_COMMAND:
switch(HIWORD(wParam))
{
case CBN_SELCHANGE:
SendMessage(combo_hwnd , CB_SETEDITSEL , 0, MAKELPARAM(-1,0));
break;
}
This doesn't change anything to my combo box, so does anybody know how to deselect the text from a combo box?
Re: deselect text in combo box
Try PostMessage rather than SendMessage.
Re: deselect text in combo box
That seems to work. Thanks.
Re: deselect text in combo box