Results 1 to 2 of 2

Thread: [RESOLVED] SendMessage edit textfield?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    291

    Resolved [RESOLVED] SendMessage edit textfield?

    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.

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: SendMessage edit textfield?

    you can loop through all the controls with the same classname using FindWindowEx API

    VB Code:
    1. Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    2.     (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    3.  
    4. Private Sub Command1_Click()
    5.     Dim lhWndParent As Long, lhWndChild As Long
    6.    
    7.     lhWndParent = ' however you're getting the parent
    8.    
    9.     Do
    10.         lhWndChild = FindWindowEx(lhWndParent, lhWndChild, "Edit", vbNullString)
    11.         If lhWndChild Then
    12.             ' Do whatever
    13.         End If
    14.     Loop While lhWndChild
    15. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width