PDA

Click to See Complete Forum and Search --> : A question that I can't answer?


Joe Bob
Dec 1st, 1999, 09:43 AM
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?

Serge
Dec 1st, 1999, 06:14 PM
If you have the window handle (hWnd) of that combobox, then you can use SendMessage API to do that.


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 (http://www.icq.com/51055819)

Joe Bob
Dec 5th, 1999, 12:47 AM
Thank you very much Serge!

I have the Window Handle, and is working!

: )