Results 1 to 2 of 2

Thread: ComboBox Question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Posts
    20

    Post

    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?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Try Sending the CB_SELECTSTRING Message to the Combobox, eg.
    Code:
    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
    [email protected]
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width