Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / January 2007



Tip: Looking for answers? Try searching our database.

How to select a listbox item in another application?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Terry Olsen - 25 Jan 2007 03:16 GMT
I need to interact with another application, such as selecting an item in a
combobox, setting the text in a textbox, checking a checkbox, etc. I know
the ControlID's for each control in the applicaiton that I need to access.
I'm assuming that I'd use the API SendMessage or PostMessage calls, but I'm
at a loss as to how to go about it.  Could someone point me in the right
direction?
mr_unreliable - 28 Jan 2007 18:34 GMT
Terry, if you know the control ID, then you can use
"GetDlgItem" to get the control handle.

Once you have the control's handle, you can send
LB_SETCURSEL to select an item.

For this and other control-specific messages, I
recommend Dan Appleman's "Visual Basic Programmer's
Guide to the Win32 API" book.

cheers, jw

> I need to interact with another application, such as selecting an item in a
> combobox, setting the text in a textbox, checking a checkbox, etc. I know
> the ControlID's for each control in the applicaiton that I need to access.
> I'm assuming that I'd use the API SendMessage or PostMessage calls, but I'm
> at a loss as to how to go about it.  Could someone point me in the right
> direction?
Terry Olsen - 29 Jan 2007 05:10 GMT
Thanks! That helped alot!

> Terry, if you know the control ID, then you can use
> "GetDlgItem" to get the control handle.
[quoted text clipped - 14 lines]
>> calls, but I'm at a loss as to how to go about it.  Could someone point
>> me in the right direction?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.