|
-
Feb 18th, 2006, 12:50 PM
#1
Thread Starter
New Member
# API question
does anyone know how I can send a listbox item to a textbox in another application with API? Im trying to do this without using SendKeys, and the other application is not mine so I cant make the textbox receive or wait for anything specific. Thanks!
-
Feb 18th, 2006, 08:39 PM
#2
Re: # API question
You get the text of a ListBox item like this:
Code:
myListBox.GetItemText(myItem)
The rest is an API question, suitable for the API forum. I'm sure that instructions on how to place text in fiels in other programs have been given multiple times before. The last step will be SendMessage, but I don't know the specifics of finding the window. Searching for SendMessage would be a good place to start.
-
Feb 18th, 2006, 09:02 PM
#3
Re: # API question
FindWindow and FindWindowEx are the other two APIs that you will need. You basically find the window handle to the main app. Then drill down the window structure to get to your desired Textbox window with FindWindowEx. Then perform the SendMessage to send the listbox text to the textbox.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 19th, 2006, 04:53 AM
#4
Thread Starter
New Member
Re: # API question
Im familiar with SendMessage, Im just not sure how to put the listbox item as a parameter of it, since in SendMessage there is class name, caption, lParam, and wParam. can the item be a int as well or does it have to be a string?
-
Feb 19th, 2006, 01:15 PM
#5
Re: # API question
Here is the definition and description of SendMessage. There is a code example at the bottom of the page.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|