I am working on a paltalk talk timer lol and I was trying to do it one way, which so far is kinda like a disaster
in the code ya will see this line
- Code: Select all
Text16 = Here where i need to add a code to get the user index ;)
wha the heck i need to do to get the nick index before i added
- Code: Select all
Public Function GetListviewItem(ByVal lstviewhwnd As Long) As String
Dim result As Long
Dim myItem As LV_ITEMA
Dim pHandle As Long
Dim pStrBufferMemory As Long
Dim pMyItemMemory As Long
Dim strBuffer() As Byte
Dim Index As Long
Dim tmpString, tmp2 As String
Dim strLength As Long
Dim ProcessID As Long
Dim ItemCount, i As Long
'**********************
'init the string buffer
'**********************
ReDim strBuffer(MAX_LVMSTRING)
'***********************************************************
'open a handle to the process and allocate the string buffer
'***********************************************************
Call GetWindowThreadProcessId(lstviewhwnd, ProcessID)
pHandle = OpenProcess(PROCESS_VM_OPERATION Or PROCESS_VM_READ Or PROCESS_VM_WRITE, False, ProcessID)
pStrBufferMemory = VirtualAllocEx(pHandle, 0, MAX_LVMSTRING, MEM_COMMIT, PAGE_READWRITE)
'************************************************************************************
'initialize the local LV_ITEM structure
'The myItem.iSubItem member is set to the index of the column that is being retrieved
'************************************************************************************
myItem.mask = LVIF_TEXT
myItem.iSubItem = 2
myItem.pszText = pStrBufferMemory
myItem.cchTextMax = MAX_LVMSTRING
'**********************************************************
'write the structure into the remote process's memory space
'**********************************************************
pMyItemMemory = VirtualAllocEx(pHandle, 0, Len(myItem), MEM_COMMIT, PAGE_READWRITE)
ItemCount = SendMessage(lstviewhwnd, LVM_GETITEMCOUNT, 0&, 0&)
For i = 0 To ItemCount - 1
result = WriteProcessMemory(pHandle, pMyItemMemory, myItem, Len(myItem), 0)
'*************************************************************
'send the get the item message and write back the memory space
'*************************************************************
result = SendMessage(lstviewhwnd, LVM_GETITEMTEXT, i, ByVal pMyItemMemory)
result = ReadProcessMemory(pHandle, pStrBufferMemory, strBuffer(0), MAX_LVMSTRING, 0)
result = ReadProcessMemory(pHandle, pMyItemMemory, myItem, Len(myItem), 0)
'**************************************************
'turn the byte array into a string and send it back
'**************************************************
For Index = LBound(strBuffer) To UBound(strBuffer)
If Chr(strBuffer(Index)) = vbNullChar Then Exit For
tmpString = tmpString & Chr(strBuffer(Index))
tmp2 = tmp2 & Chr(strBuffer(Index))
Next Index
tmp2 = Replace(tmp2, "@", "")
Text17 = tmp2
Text16 = Here where i need to add a code to get the user index ;)
tmp2 = ""
Next
'
'**************************************************
'deallocate the memory and close the process handle
'**************************************************
result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
result = VirtualFreeEx(pHandle, pMyItemMemory, 0, MEM_RELEASE)
result = CloseHandle(pHandle)
If Len(tmpString) > 0 Then GetListviewItem = tmpString
End Function
And I am calling with this
- Code: Select all
Function NickGet()
Dim dlggroupchatwindowclass As Long, wtlsplitterwindow As Long, atldd As Long
Dim syslistview As Long
On Error Resume Next
dlggroupchatwindowclass = FindWindow("DlgGroupChat Window Class", Form1.Text1)
wtlsplitterwindow = FindWindowEx(dlggroupchatwindowclass, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
wtlsplitterwindow = FindWindowEx(wtlsplitterwindow, 0&, "wtl_splitterwindow", vbNullString)
atldd = GetWindow(wtlsplitterwindow, GW_CHILD)
syslistview = FindWindowEx(atldd, 0&, "syslistview32", vbNullString)
Call GetListviewItem(syslistview)
End Function
Thanks for ya help





