PDA

Click to See Complete Forum and Search --> : ComboBox Question


Joe Bob
Dec 7th, 1999, 06:32 AM
Ok, I posted a message about this before.

Now my program is getting complicated..
There is a diffrent program, Im trying to select guest that is in the combobox.

----Code----
Dim signon as long
Parent = findwindow(0, 0, "Parent Frame", vbnullstring)
mdichild = findwindowex(Parent, 0, "MDI Client", vbnullstring)
signon = FindWindowEx(mdichild, 0, "Child", "Sign On")
signCombo = FindWindowEx(signon, 0, "Combobox", vbNullString)
----code----

I found all the HWND above,

In the other program, these are the stuff that are in the combobox>
-Helper
-Online Helper
-Options
-Sign On 32
-Guest
<the sign on 32 changes in the combobox list every time the program opens(sign on 56, sign on 53.. ect)


How do I select Guest from the combobox list using API?

Aaron Young
Dec 8th, 1999, 01:25 AM
Try Sending the CB_SELECTSTRING Message to the Combobox, eg.

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_SELECTSTRING = &H14D

Private Sub Command1_Click()
'lHwnd is the Handle of the Combobox you Found Previously..
Call SendMessage(lHwnd, CB_SELECTSTRING, -1, ByVal "Guest")
End Sub


------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net