c++ - Custom ComboBox for SearchBox -


I have a custom Kanbaboks to have been applied to behave like a search box is an edit control, a button And have been created from a listbox.

I'm trying to open the listbox to click the mouse button, it can be easy, but seemed to be complicated. Most First I tried to manage mouse click on "BN_CLICKED", but then I found out that it is too late and I want to open before the listbox on "WM_LBUTTONDOWN" (and "WM_LBUTTONDBLCLK"), problem that is, when I try to open a list box on the 'm the message "WM_KILLFOCUS" the listbox and being right off after being opened for a moment, and the button "WM_SETFOCUS" message Is, I "WM_SETFOCUS" List was thinking of opening the box "receives a button, but because I can not trust the message to click each button (for example, when I will not be sent to click on the button).

Would not it be easier to just start with a tell to a window class that

  wndproc comboboxwndproc? LRESULT callback MyComboBoxWndProc (HWND hwnd, uint uMsg, wParam wParam, lParam lParam) {switch (uMsg) {/ * * /} CallWindowProc return to work (comboboxwndproc, hwnd, uMsg, wParam, lParam); } Void register_custom_combobox () {WINDOWCLASSEX mycbwc; Four mycbwcname [] = "MYCOMBOBOX"; Mycbwc.cbSize = sizeof (WNDCLASSEX); GetClassInfoEx (NULL, "COMBOBOX", and mycbwc); ComboBoxWandProject = CBCCLPFNWDC Mycbwc.lpfnWndProc = MyComboBoxWndProc; Mycbwc.hInst = my_instance; Mycbwc.lpszClassName = mycbwcname; RegisterClassEx (& mycbwc); }  

If you wanted, you can place the reserved space in the classroom extra field instead of using global variables. In custom window proc, check to see if it has already been set, and if not, then request the information of the Combo box class again and put the pointer in the combobox window prok in the class extra area. .


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -