请问已经得到窗口的句柄,怎么循环选择窗口里面的LISTBOX?由于API不熟,希望能提供详细的例子。谢谢

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/4969/4969697.xml?temp=.3553888http://community.csdn.net/Expert/topic/5064/5064370.xml?temp=.5880548
      

  2.   

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate 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
    Dim hWnd1 As Long, hWnd2 As Long    hWnd1 = FindWindow("你的窗体标题", vbNullString)
        Do
            hWnd2 = FindWindowEx((hWnd1, hWnd2, "ListBox",vbNullString )
            If hWnd2 Then Debug.Print hWnd2
        Loop While hWnd2在 FindWindowEx 函数调用时的类名我不能确定,你再查证一下。