Solved

How to select an item in combobox of another application.

Posted on 2000-03-27
4
639 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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