1. Combo box edit control 'children'
- Posted by wolfgang fritz <wolfritz at KING.IGS.NET> Oct 07, 1999
- 422 views
Could anyone tell me why this won't work? I'm trying to get the handle of an edit control window in a combo box, using the example in win32.hlp: ( Creating a Combo-box Toolbar ), which is in 'C". I can't seem to get any valid "ChildWindowFromPoint" values. ...Thanks for any help, Wolf --start code-- include win32lib.ew without warning atom junk global constant Win = create(Window,"edit-control",0,0,0,200,200,0), --to find edit control child of combo. combo=create(Combo,"",Win,20,10,150,60,0), s_combo=create(SortedCombo,"",Win,20,90,150,60,0) puts(1,"\nlinkFunc_id=") printf(1,"%d",{findchild}) puts(1,"\nwin32lib_combo_id=") printf(1,"%d",{combo}) sequence txt txt={"one","two","three"} --the 'points' structure atom points points = allocate(8) poke4(points,1) poke4(points+4,1) procedure onLoad_Win() atom childhandle,winhandle --add some list items to both combo's for j=combo to s_combo do for k = 1 to 3 do addItem( j, sprintf( "%s", {txt[k]})) end for end for --send CB_SETCURSEL message to first combo junk=sendMessage(combo,CB_SETCURSEL,2,0) --( item #3,zero indexed! ) puts(1,"\nlist_index=") printf(1,"%d",{junk}) winhandle=getHandle(combo) puts(1,"\nwin_id_of_combo=") printf(1,"%d",{winhandle}) childhandle=c_func(findchild,{winhandle,points}) puts(1,"\nwin_id_of_edit_control=") printf(1,"%d",{childhandle}) end procedure onOpen[ Win ] = routine_id( "onLoad_Win" ) WinMain( Win, Normal ) --end code--
2. Re: Combo box edit control 'children'
- Posted by wolfgang fritz <wolfritz at KING.IGS.NET> Oct 07, 1999
- 425 views
.. OOPS ! .. I should have mentioned that I have re-defined: Combo and SortedCombo in win323lib as follows: classStyle[ Combo ] = or_all( { WS_CHILD, WS_VISIBLE, WS_VSCROLL, CBS_DISABLENOSCROLL, CBS_DROPDOWN, CBS_HASSTRINGS, WS_TABSTOP} ) classStyle[ SortedCombo ] = or_all( { WS_CHILD, WS_VISIBLE, WS_VSCROLL, CBS_DISABLENOSCROLL, CBS_DROPDOWN, CBS_HASSTRINGS, CBS_SORT, WS_TABSTOP} ) ...since the definitions in win32lib ver.43d do not even seem to have an edit control. ( that blinking curser in a box thingie ! ) ...there may be something wrong with my definitions too. Wolf
3. Re: Combo box edit control 'children'
- Posted by Ad Rienks <kwibus at DOLFIJN.NL> Oct 07, 1999
- 444 views
Wolf, I'm in a hurry right now, haven't got much time, but I think what you're looking for is called a 'DropDownList' in Win32Lib. If possible, I will have a look at your code tonight, or maybe David's got an answer, if he's not to ill. BTW, why do you use puts() and printf() next to each other, where a single printf() would work too? Bye, ^ | /-\<| On Thu, 7 Oct 1999 11:18:36 -0400, wolfgang fritz <wolfritz at KING.IGS.NET> wrote: >Could anyone tell me why this won't work? >I'm trying to get the handle of an edit control window in a combo box, >using the example in win32.hlp: >( Creating a Combo-box Toolbar ), which is in 'C". >I can't seem to get any valid "ChildWindowFromPoint" values. > >...Thanks for any help, Wolf > >--start code-- >include win32lib.ew >without warning >atom junk > >global constant Win = >create(Window,"edit-control",0,0,0,200,200,0), >--to find edit control child of combo. {C_LONG,C_POINTER},C_LONG), > >combo=create(Combo,"",Win,20,10,150,60,0), > >puts(1,"\nlinkFunc_id=") printf(1,"%d",{findchild}) >puts(1,"\nwin32lib_combo_id=") printf(1,"%d",{combo}) > >sequence txt >txt={"one","two","three"} > >--the 'points' structure >atom points > points = allocate(8) > poke4(points,1) > poke4(points+4,1) > >procedure onLoad_Win() >atom childhandle,winhandle > >--add some list items to both combo's >for j=combo to s_combo do >for k = 1 to 3 do >addItem( j, sprintf( "%s", {txt[k]})) >end for >end for > >--send CB_SETCURSEL message to first combo >junk=sendMessage(combo,CB_SETCURSEL,2,0) --( item #3,zero indexed! ) >puts(1,"\nlist_index=") printf(1,"%d",{junk}) > >winhandle=getHandle(combo) >puts(1,"\nwin_id_of_combo=") printf(1,"%d",{winhandle}) > >childhandle=c_func(findchild,{winhandle,points}) >puts(1,"\nwin_id_of_edit_control=") printf(1,"%d",{childhandle}) >end procedure > >onOpen[ Win ] = routine_id( "onLoad_Win" ) >WinMain( Win, Normal ) >--end code--