What's wrong with the code in the first post? Do you need help? Did you declare everything?
thank u for u reply. Well i realy need help declaring needed things. i be happy if u tell me what controles and things i need to make that code run. This is the informaton i got from my externallistview:
Window Handle == 0x00310520.
Class Name : SysListView32.
RECT.left == 799.
RECT.top == 195.
RECT.right == 995.
RECT.bottom == 462.
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
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As Any) As Long
Thank u for u reply . could u tell me how to make the on command event. Where to put them ?I only want select and highlight for example the 2 listview item .The current listview does not allow select all. i tried this and got this error :
compile error:
Constant expression required
and pointing at LVM_FIRST
complete code:
VB Code:
Const LVIF_STATE As Long = &H8
Const LVIS_SELECTED As Long = &H2
Const LVIS_FOCUSED As Long = &H1
Const LVM_SETITEMSTATE As Long = ([B]LVM_FIRST [/B] + 43)
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
You will have to find the number of items in the listview and then select them one by one. If I'm not mistaken you have to change the 3rd parameter of the SendMessage call.
Has someone helped you? Then you can Rate their helpful post.
You will have to find the number of items in the listview and then select them one by one. If I'm not mistaken you have to change the 3rd parameter of the SendMessage call.
Many thanks for u reply. adding that line did not solve the error. error Pointing at same spot!
How to get the number of items in externallistview ? I just want to highlight say for example item number 4. could u tell me what should i put in 3rd parameter.Thanks
You didn't add the LVM_FIRST declaration that I posted above. The above should work and highlight the first item. For the 2nd item you should use (I'm guessing) :
Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByRef lParam As Any) As Long
HAve u tried this code ? did it work for u?
I think this code will not work for externallistview since at no point code is looking for a window that holds the listvidew!!
AS u see i provied the classname and listview info beleow so i be happy if u have a look at it.Thanks
This is the informaton i got from my externallistview using api spy:
Window Handle == 0x00310520.
Class Name : SysListView32.
RECT.left == 799.
RECT.top == 195.
RECT.right == 995.
RECT.bottom == 462.
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