Results 1 to 6 of 6

Thread: Problem getting hwnd of external listview

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Problem getting hwnd of external listview

    Hi all. There is an external application that has a listview in one of its window. My intention is to highlight and send double click to one of its row .

    So i tried to get the listview's hWnd value first but I don't know what class name it has. Most of other listviews got systemlistview32 name but not this one.I used PAT Jk's API spy 5.1 to get the code that help me find hWnd of the listview but unfortunetly when i used the PAT JK'S API Spy's code with the following code i got empty value for hwnd!

    So I be happy if you guys tell me how we can deal with such a listview and find it hwnd valu? Looking forward for replies.Thanks

    2 Code:
    1. Private Sub Command1_Click()
    2.  
    3. Dim hWnd As Long
    4. hWnd = getHwnd
    5.  
    6. End sub
    7.  
    8.  
    9. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    10. 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
    11.  
    12. Function getHwnd() As Long
    13. 'this part i used PAT or Jk's API spy 5.1
    14.  
    15. Dim atlc As Long, atlcf As Long, atla As Long
    16.  
    17. atlc = FindWindow("atl:008047c0", vbNullString)
    18. atlcf = FindWindowEx(atlc, 0&, "atl:00819cf0", vbNullString)
    19. atla = FindWindowEx(atlcf, 0&, "atl:00819a30", vbNullString)
    20.  
    21. getHwnd=atla
    22.  
    23. End Function
    Last edited by tony007; Apr 14th, 2009 at 05:32 PM.

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