|
-
Feb 8th, 2000, 11:43 AM
#1
Thread Starter
Junior Member
I have program that will enter text into a 3rd party program's specific textbox. Now this 3rd party proggie has A parent window, then a child, on the child is several other childs, on one of the childs is the textbox I need to manipulate. I know what the main parent's class name is and I know that the name for the target textbox is "Edit", but there also 18 other textboxes named edit...Soooo I will have to specify the target textboxe's index. How do I figure out what the index is for the target textbox?
Here is the unfinished code I am currently using:
'Window Handles change every time a Window is Created, you can find the Window Handle using the API "FindWindowEx()".
'You can Pass a Window Caption or Class, you can also search within other Windows, the following searches for a Textbox.
Dim lHwnd As Long
Dim sText As String
Dim iIndex As Integer
Dim lChildWnd As Integer
sText = Text1
'lHwnd = A window's handle you desire (in this particular code it is not needed since it is unknown, but if it was known, you could cut to the chase and just use it. Refer to SendKey_part2).
'3rdPartyAppClass is the Classname of the 3rd Party App.
'3rdPartyClass needs to be replaced with the Class name of the Main Window of the 3rd Party Application.
lHwnd = FindWindowEx(0, 0, "3rdPartyAppClass", vbNullString)
'iIndex is the parentwindow's specific textbox (childwindow) index.
'I am using iIndex simply because CCS has many textboxes, and each one will have their own indicies.
'Our code will have to search all childwindows by their indexes, inorder to find the target textbox.
For iIndex = 1 To 18
'Edit is the Classname for a Standard Windows Textbox.
lChildWnd = FindWindowEx(lHwnd, lChildWnd, "Edit", vbNullString)
Next
'lChildWnd is the target child window.
SendMessage lChildWnd, WM_SETTEXT, Len(sText), ByVal sText
End Sub
I would do anything to find a solid way to make my program edit the correct textbox in the 3rd party program. I will gladly kiss the feet of the hot dog coder who makes this a reality for me 
I can't sleep well till I get it right.
Daniel Christie
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
|