已经一个LISTVIEW控件的句柄,要怎么样复制里面的数据出来,
此功能主要是做一个小软件的外挂,复制出来后自动保存我手上没分了,希望大家可以帮这个忙,谢谢,

解决方案 »

  1.   

    lvSelected   =   SendMessage(hWndlistView,   &H1000&   +   66&,   0,   ByVal   0&)   '获取列表的选定项索引刚才找到的,大家一起论坛一下。
      

  2.   

    Public Function GetItemTextByProcess$(ByVal Hwnd As Long, ByVal PIDs As Long, ByVal Index As Long, ByVal SubIndex As Long)
    Dim Handle&, Memory&(1), Item As LVITEM2, Temp() As Byte, Buffer(260) As Byte
    Handle = OpenProcess(2035711, 0, PIDs)
    If Handle = 0 Then Exit Function
    Memory(0) = VirtualAllocEx(Handle, 0, 260, 4096, 4)
    With Item
    .iSubItem = SubIndex
    .TextSize = 260
    .Text = Memory(0)
    End With
    ReDim Temp(LenB(Item))
    Memory(1) = VirtualAllocEx(Handle, 0, LenB(Item), 4096, 4)
    WriteProcessMemory Handle, Memory(1), Item, LenB(Item), 0
    If SendMessage(Hwnd, 4141, Index, Memory(1)) > 0 Then
    ReadProcessMemory Handle, Memory(1), Temp(0), LenB(Item), 0
    CopyMemory LenB(Item), VarPtr(Item), VarPtr(Temp(0))
    If Item.Text > 0 Then
    ReadProcessMemory Handle, Item.Text, Buffer(0), 260, 0
    GetItemTextByProcess = StrConv(Buffer, vbUnicode)
    GetItemTextByProcess = Left(GetItemTextByProcess, InStr(1, GetItemTextByProcess, vbNullChar) - 1)
    End If
    End If
    VirtualFreeEx Handle, Memory(0), 0, 32768
    VirtualFreeEx Handle, Memory(1), 0, 32768
    CloseHandle Handle
    End Function
      

  3.   

    对了,LVITEM结构体的Text As String要改为As Long,因为是指向别的进程的内存地址指针