Results 1 to 3 of 3

Thread: A question that I can't answer?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Posts
    20

    Post

    Hello again,

    A new problam occured at 0'3:30.

    I need to switch the combobox that is in another application.

    Let's say the combo box has dog,cat,fish, in it.

    The combobox is set to CAT.

    How do I use API and switch the combobox to DOG?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    If you have the window handle (hWnd) of that combobox, then you can use SendMessage API to do that.

    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
    
    
    '-------Use this on any event
        Call SendMessage(ComboboxHwnd, CB_SELECTSTRING, -1, ByVal "Dog")
    ------------------

    Serge

    Software Developer
    Serge_Dymkov@vertexinc.com
    Access8484@aol.com
    ICQ#: 51055819


  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Posts
    20

    Post

    Thank you very much Serge!

    I have the Window Handle, and is working!

    : )

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