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:
Private Sub Command1_Click()
Dim hWnd As Long
hWnd = getHwnd
End sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
Thanks for reply . I realy don't know how to use visual studio 6 spy++ but i tried it by clicking search ==> find window and dragged the finder tool over the listview and this is what i got :
Spy++ says it all, the control's class name is Button, you can try
Code:
atlc = FindWindow("Button", "Video Library")
Didn't work . I got 0 for hWnd!! Can you look at the above attached image of the window that holds the listview and see if i we are in right path ?
2 Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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
IMO it looks like the Listview is a child of a Frame; which would have a caption of "Video Library", the RatioBox at the top of the app also has a caption of "Video Library", and is more likely to be a "Button" Class than the frame would.