[win32lib] subclassing Combo's EditText
- Posted by Martin Stachon <martin.stachon at worldonline.cz> Jul 13, 2002
- 500 views
I need to set some handlers for EditText field of ComboBox. I tried to subclass it according to this example from Microsoft: <c code> /* Get the edit window handle for each combo box. */ pt.x = 1; pt.y = 1; hwndEdit1 = ChildWindowFromPoint(hwndCombo1, pt); hwndEdit2 = ChildWindowFromPoint(hwndCombo2, pt); /* * Change the window procedure for both edit windows * to the subclass procedure. */ lpfnEditWndProc = (WNDPROC) SetWindowLong(hwndEdit1, GWL_WNDPROC, (DWORD) SubClassProc); SetWindowLong(hwndEdit2, GWL_WNDPROC, (DWORD) SubClassProc); </c code> <eu code> -- subclass the edit control pt = acquire_mem( 0, SIZEOF_POINT ) store(pt, ptX, 1) -- also tried [5,5];[10,10] etc. store(pt, ptY, 1) pComboBoxEdit = w32Func(ChildWindowFromPoint, {getHandle(pComboBox), pt}) ? pComboBoxEdit release_mem(pt) pComboBoxEdit = subClassControl( {EditText, pWin}, pComboBoxEdit) ? pComboBoxEdit </eu code> But the output is: 0 0 - this means that ChildWindowFromPoint failed. What I am doing wrong or is there another way to get handle of the EditText? Regards, Martin Stachon martin.stachon at tiscali.cz http://www.webpark.cz/stachon