duplicate classnames? - SOLVED - GO AWAY SANCHEZ
Im trying to send text to a textbox with api, easy. The problem is, there are 2 text boxes in the program and they have the same classname and same text. The only thing that keeps them independant is their hwnds.
Problem is, I am getting the first textbox's hwnd and not the second one, which is what I need.
Is it possible to like skip the first result my app gets and then continue to the next one?
Heres what im using:
VB Code:
Private Sub Command1_Click()
hwndd = FindWindow("parentCLASS", vbNullString)
MsgBox FindWindowEx(hwndd, 0, "textCLASS", vbNullString)
End Sub
which gives me the first textbox's hwnd.
Re: duplicate classnames?
Try this:
VB Code:
Private Sub Command1_Click()
Dim hwndd&, hwndd2&
hwndd = FindWindow("parentCLASS", vbNullString)
hwndd2 = FindWindowEx(hwndd, 0, "textCLASS", vbNullString)
MsgBox FindWindowEx(hwndd, hwndd2, "textCLASS", vbNullString)
End Sub
Using OE in your coding wouldn't hurt either.