如果使用API函数向已知句柄的LISTVIEW复制数据出来 已经一个LISTVIEW控件的句柄,要怎么样复制里面的数据出来,此功能主要是做一个小软件的外挂,复制出来后自动保存我手上没分了,希望大家可以帮这个忙,谢谢, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 lvSelected = SendMessage(hWndlistView, &H1000& + 66&, 0, ByVal 0&) '获取列表的选定项索引刚才找到的,大家一起论坛一下。 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 ByteHandle = OpenProcess(2035711, 0, PIDs)If Handle = 0 Then Exit FunctionMemory(0) = VirtualAllocEx(Handle, 0, 260, 4096, 4)With Item.iSubItem = SubIndex.TextSize = 260.Text = Memory(0)End WithReDim Temp(LenB(Item))Memory(1) = VirtualAllocEx(Handle, 0, LenB(Item), 4096, 4)WriteProcessMemory Handle, Memory(1), Item, LenB(Item), 0If SendMessage(Hwnd, 4141, Index, Memory(1)) > 0 ThenReadProcessMemory Handle, Memory(1), Temp(0), LenB(Item), 0CopyMemory LenB(Item), VarPtr(Item), VarPtr(Temp(0))If Item.Text > 0 ThenReadProcessMemory Handle, Item.Text, Buffer(0), 260, 0GetItemTextByProcess = StrConv(Buffer, vbUnicode)GetItemTextByProcess = Left(GetItemTextByProcess, InStr(1, GetItemTextByProcess, vbNullChar) - 1)End IfEnd IfVirtualFreeEx Handle, Memory(0), 0, 32768VirtualFreeEx Handle, Memory(1), 0, 32768CloseHandle HandleEnd Function 对了,LVITEM结构体的Text As String要改为As Long,因为是指向别的进程的内存地址指针 vb6中有什么有没有和mschart一样的画图组件? 建议帖:在发帖或回复中,加上显示IP地址的头2段或者3段 请为VB实现多线程要用到那些知识点,有没有示例代码可以下载 ActiveReports问题 請問如何使窗體的還原失效,(是當用戶在窗體的標題欄雙擊是窗體不還原) 帮我做个同步专家这样的软件要多少钱啊! 有诚意的出个价, 制作人要在上海哦 求题库系统中的随机抽题生成试卷部分代码 有一个概念性的问题想问问。 WebBrower1中模拟点击A标签(dedecms后台文章编辑控件) 救急!!!数据库多重绑定错误? keypress事件中 接收回车键 会有声音 对VBA失望了……求救
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