+
+// ----------------------------------------------------------------------------
+// function prototypes
+// ----------------------------------------------------------------------------
+
+LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam);
+
+// ---------------------------------------------------------------------------
+// global vars
+// ---------------------------------------------------------------------------
+
+// the pointer to standard radio button wnd proc
+static WXFARPROC gs_wndprocEdit = (WXFARPROC)NULL;
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wnd proc for subclassed edit control
+// ----------------------------------------------------------------------------
+
+LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd,
+ UINT message,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ HWND hwndCombo = ::GetParent(hWnd);
+ wxWindow *win = wxFindWinFromHandle((WXHWND)hwndCombo);
+
+ switch ( message )
+ {
+ // forward some messages to the combobox to generate the appropriate
+ // wxEvents from them
+ case WM_KEYUP:
+ case WM_KEYDOWN:
+ case WM_CHAR:
+ case WM_SETFOCUS:
+ case WM_KILLFOCUS:
+ {
+ wxComboBox *combo = wxDynamicCast(win, wxComboBox);
+ if ( !combo )
+ {
+ // we can get WM_KILLFOCUS while our parent is already half
+ // destroyed and hence doesn't look like a combobx any
+ // longer, check for it to avoid bogus assert failures
+ if ( !win->IsBeingDeleted() )
+ {
+ wxFAIL_MSG( _T("should have combo as parent") );
+ }
+ }
+ else if ( combo->MSWProcessEditMsg(message, wParam, lParam) )
+ {
+ // handled by parent
+ return 0;
+ }
+ }
+ break;
+
+ case WM_GETDLGCODE:
+ {
+ wxCHECK_MSG( win, 0, _T("should have a parent") );
+
+ if ( win->GetWindowStyle() & wxPROCESS_ENTER )
+ {
+ // need to return a custom dlg code or we'll never get it
+ return DLGC_WANTMESSAGE;
+ }
+ }
+ break;
+
+ // deal with tooltips here
+#if wxUSE_TOOLTIPS && defined(TTN_NEEDTEXT)
+ case WM_NOTIFY:
+ {
+ wxCHECK_MSG( win, 0, _T("should have a parent") );
+
+ NMHDR* hdr = (NMHDR *)lParam;
+ if ( (int)hdr->code == TTN_NEEDTEXT )
+ {
+ wxToolTip *tooltip = win->GetToolTip();
+ if ( tooltip )
+ {
+ TOOLTIPTEXT *ttt = (TOOLTIPTEXT *)lParam;
+ ttt->lpszText = (wxChar *)tooltip->GetTip().c_str();
+ }
+
+ // processed
+ return 0;
+ }
+ }
+ break;
+#endif // wxUSE_TOOLTIPS
+ }
+
+ return ::CallWindowProc(CASTWNDPROC gs_wndprocEdit, hWnd, message, wParam, lParam);
+}
+
+WXHBRUSH wxComboBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
+#if wxUSE_CTL3D
+ WXUINT message,
+ WXWPARAM wParam,
+ WXLPARAM lParam
+#else
+ WXUINT WXUNUSED(message),
+ WXWPARAM WXUNUSED(wParam),
+ WXLPARAM WXUNUSED(lParam)