Results 1 to 2 of 2

Thread: Handle on a form

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Location
    Chicago
    Posts
    6
    I'm having a problem locating a handle of a edit control. I've heard that when locating a handle in VB the API searches from left to right on your form. This is a part of the code i'm using. It seems to be getting the handle correct until it reaches Lchild4 then it goes off in another direction on the form and Lchild5 returns a 0, Is there another way of locating the edit control i want? Sorry, If this post is a little confusing.

    Dim lParent As Long
    lParent = FindWindow(vbNullString, AppName)
    Dim lChild1 As Long
    lChild1 = FindWindowEx(lParent, 0, "AfxFrameOrView42s", vbNullString)
    Dim lChild2 As Long
    lChild2 = FindWindowEx(lChild1, 0, "AfxFrameOrView42s", vbNullString)
    Dim lChild3 As Long
    lChild3 = FindWindowEx(lChild2, 0, "AfxFrameOrView42s", vbNullString)
    Dim lChild4 As Long
    lChild4 = FindWindowEx(lChild3, 0, "AfxFrameOrView42s", vbNullString)
    Dim lChild5 As Long
    lChild5 = FindWindowEx(lParent, 0, "Edit", vbNullString)

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    60
    How many edit controls have you got on your form that you are searching, note that if they are not enabled or invisible you cannot retrieve the handle for the control.

    Grant French
    -----------------------------------------------
    E-Mail: [email protected]
    ICQ: 33122184

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