Combo box edit control 'children'

new topic     » topic index » view thread      » older message » newer message

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--

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu