1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
Function fnWndProc_OnCreate(wea As WndEventArgs) As Long
Local pCreateStruct As CREATESTRUCT Ptr
Local szNames() As Asciiz*16
Local hCtrl,dwStyle As Dword
pCreateStruct=wea.lParam : wea.hInst=@pCreateStruct.hInstance
dwStyle=%WS_CHILD Or %WS_VISIBLE Or %CBS_DROPDOWNLIST Or %WS_VSCROLL
'hCtrl=CreateWindow("combobox","",dwStyle,20,10,120,150,Wea.hWnd,%IDC_COMBOBOX,Wea.hInst,ByVal 0)
hCtrl=CreateWindow("combobox","",dwStyle,0,0,0,0,Wea.hWnd,%IDC_COMBOBOX,Wea.hInst,ByVal 0)
Redim szNames(5) As Asciiz*16
szNames(0)="Frederick"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(0)))
szNames(1)="Elsie"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(1)))
szNames(2)="Scott"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(2)))
szNames(3)="Joseph"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(3)))
szNames(4)="Martha"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(4)))
szNames(5)="Ruth"
Call SendMessage(hCtrl,%CB_INSERTSTRING,-1,Varptr(szNames(5)))
Erase szNames()
MoveWindow(hCtrl,20,10,120,150,%FALSE)
fnWndProc_OnCreate=0
End Function
|