|
-
Jan 1st, 2001, 06:42 PM
#1
Thread Starter
Junior Member
Does anyone know how to insert items into a combobox that was created with the createwindow API?
-
Jan 1st, 2001, 11:38 PM
#2
Fanatic Member
It should be something similar to this, didn't test it so you may have to fool around with it to get it to work..
Code:
Call SendMessage(lHWND, LB_ADDSTRING, 0, "HELLO")
Where lHWND is the handle to your combo box.
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Jan 2nd, 2001, 01:08 AM
#3
Thread Starter
Junior Member
I have been trying to get that sendmessage to work and still seem to be having problems with it. I have tried:
SendMessage myComboBox, CB_ADDSTRING, 0, "HELLO" and
Call SendMessage (myComboBox, CB_ADDSTRING, 0, "HELLO")
with no luck in either one.
If it helps any, I have this combo box sitting in the quicklaunch menu on the taskbar. Could this have anything to do with it? Would I have to get the device context or something along this line in order to manipulate the contents of the combobox?
-
Jan 30th, 2001, 03:08 PM
#4
Lively Member
I was trying to do the same thing to speed up my app.....YoungBuck got me on the right track.....heres the code I got to work using the API.
Code:
Sub Form_Load()
dim i as Integer
With Combo1
For i = 0 To Printer.FontCount - 1
SendMessage .hWnd, CB_ADDSTRING, 0, ByVal Printer.Fonts(i)
Next i
.ListIndex = 0
End With
End Sub
Hope this helps 
-
Jan 30th, 2001, 03:19 PM
#5
You need the ByVal keyword.
Code:
Call SendMessage(lHWND, LB_ADDSTRING, 0, ByVal "HELLO")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|