Saturday, 15 September 2012

winapi - How to capture “Enter key” in combobox using WIN32 API (C/C++)? -


I for example to enter How do you capture the event you want to catch when the user presses Kanbod: my combo box I type "Nguyen Fong Sack" in After the Enter key is pressed, it appears a message: "Nguyen Phong Sac" help,

< p> I still want to know that you're writing the program how, but I'll give it to you asked you as an example:
  // test with Windows 7 x64 It was, VS2012 // when Making: hWndComboBox = CreateWindow (WC_COMBOBOX, text ( ""), CBS_DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE, exposed, UPS, Anvidth, Knight, Acdblu Eepiar, narwhal, Acaiansitiaisisimpennet, null); HWndEditBox = CreateWindow (WC_EDIT, TEXT (""), CBS DROPDOWN | CBS_HASSTRINGS | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE, xpos, ypos-30, nwidth, 30, hwndparent, NULL, HINST_THISCOMPONENT, NULL); // The editing in the combobox has been done before the control HWW HW Edited = Gatevondo (HWWCMbbox, GW_HCLD); // used to create SetWindowLong subclass, lpfnEditWndProc core proc lpfnEditWndProc = (wndproc) SetWindowLong (hwndEdit, GWL_WNDPROC, (DWORD) SubClassProc); // Subclass Proc LRESULT Callback SubClassProc (HWND hwnd, uint message, wParam wParam, lParam lParam) {Switch (MSG) {In case WM_KEYDOWN: switch (wParam) {case VK_RETURN: // Get text & go, set text LPTSTR buffer = New TCHAR [255]; GetWindowText (hwnd, buffer, 255); Setwindotext (HWF & Tbox, buffer); break; } break; } Return Colvandoprok (Elpifanadit Veedproc, Acdbludi, MMS, Dblupiamm, Elpiamm); }    

No comments:

Post a Comment