I already know how to edit textfields with SendMessage, but how do I edit a textfield when there's more of them, and they don't have a unique name.
Printable View
I already know how to edit textfields with SendMessage, but how do I edit a textfield when there's more of them, and they don't have a unique name.
you can loop through all the controls with the same classname using FindWindowEx API
VB Code:
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _ (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long Private Sub Command1_Click() Dim lhWndParent As Long, lhWndChild As Long lhWndParent = ' however you're getting the parent Do lhWndChild = FindWindowEx(lhWndParent, lhWndChild, "Edit", vbNullString) If lhWndChild Then ' Do whatever End If Loop While lhWndChild End Sub