Solved

How to select an item in combobox of another application.

Posted on 2000-03-27
4
698 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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