Solved

How to select an item in combobox of another application.

Posted on 2000-03-27
4
524 Views
Last Modified: 2010-04-04
I write an application to select the items in the combobox of  another application.
I got window handle for Combobox and I sent.
sendmessage(ghwndCombo, WM_LBUTTONDOWN, 0, 0);
  sendmessage(ghwndCombo, WM_LBUTTONUP, 0, 0);
Then, I can see a list of items in combobox but I can not select the item that I want to. How to select an item in combobox?. What parameter to pass in Sentmessage function?.
0
Comment
Question by:Suttee
  • 2
4 Comments
 

Author Comment

by:Suttee
ID: 2656747
Adjusted points from 50 to 60
0
 

Author Comment

by:Suttee
ID: 2656776
Adjusted points from 60 to 100
0
 
LVL 21

Expert Comment

by:gemarti
ID: 2661691
Try:

SendMessageCallback(
hWnd: HWND;  //handle to a window
Msg: UINT; //the identifier of the msg. to send
wParam:WPARAM; //32bit msg value
lParam: LPARAM; //32bit msg value
lpResultCallBack:TFNSendAsyncProc; //pointer to an app-defined callback procedure
dwData:DWORD //app defined value
); BOOL  // returns true or false

0
 
LVL 1

Accepted Solution

by:
vorisek earned 100 total points
ID: 2754483
An application sends a CB_SETCURSEL message to select a string in the list of a combo box:

CB_SETCURSEL
wParam = (WPARAM) index;  // item index
lParam = 0;               // not used;

sendmessage(ghwndCombo, CB_SETCURSEL, index, 0)

You can also use CB_SELECTSTRING to select defined string.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now