shabbir, if you've got a few minutes, I was wondering if you could help me with trapping the VK_RETURN message. I've created the combo box as Code: CreateWindow(TEXT("COMBOBOX"), TEXT(""), WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_DROPDOWN, 82, 220, 100, 20, hwnd, (HMENU)myIDC_WILDCARD, global_instance, NULL); This gets created / destroyed during tab control changes. What I'm hoping to do is when the user types a string in the edit portion and hits return, I add the string to the list. My problem is that I cannot seem to catch the VK_RETURN message. \n doesn't seem to be present in the user's string during CBN_EDITCHANGE Is VK_RETURN sent to the combox box, the edit portion, or maybe the tab or even parent? Sub classing has proven to be a major headache for a layman like myself. Any ideas?
VK_RETURN may not be present in the string because it sends triggers other events. Like when pressing tab means it looses focus and so in that event handler you have to make such that focus is driven back to the control. Similarly for Enter or return. Not sure but does that control support multiline - ES_MULTILINE? If it does not support that then you may not be able to get those in the string. If it does then you may enable that and then enter may work like normal and will be part of the string.
Thank you for the reply - I appreciate it. It doesn't look like ES_MULTILINE has any effect; from MS, it *looks* like subclassing is the only way to determine whether or not return was pressed. I couldn't figure out the sub class procedure though as it completely trashed my tab... I just don't know enough to work with it. I decided to scan the input string for a designated character instead.