Solved

How to select an item in combobox of another application.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 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

15 Experts available now in Live!

Get 1:1 Help Now