来自sysListView32树的文本 [英] Text from sysListView32 tree
本文介绍了来自sysListView32树的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试从另一个进程获取一个字符串sysListView32。
列表是一个树。并且对于第一列返回一个空字符串。
告诉我问题在哪里?
Itrying to get a out of a string sysListView32 from another process. The list is a tree. And for the first column returns an empty string. Tell me where is the problem?
树的图片:
tree
代码:
Image of tree: tree Code:
vProcess = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ |
PROCESS_VM_WRITE, False, vProcessId);
vPointer = VirtualAllocEx(vProcess, NULL, 4096, MEM_RESERVE | MEM_COMMIT,
PAGE_READWRITE);
vItem.mask = LVIF_TEXT;
vItem.iItem = I;
vItem.iSubItem = J;
vItem.cchTextMax = sizeof(vBuffer);
vItem.pszText = (wchar_t*)vPointer +sizeof(TLVItem);
WriteProcessMemory(vProcess, vPointer, &vItem, sizeof(TLVItem),
&vNumberOfBytesRead);
SendMessageW(mHandle, LVM_GETITEMW, I, (LPARAM)vPointer);
ReadProcessMemory(vProcess, (wchar_t*)vPointer +sizeof(TLVItem),
vBuffer, sizeof(vBuffer), &vNumberOfBytesRead);
RESULT = UnicodeString(vBuffer);
VirtualFreeEx(vProcess, vPointer, 0, MEM_RELEASE); // free mem
CloseHandle(vProcess);
推荐答案
过程,所以它不存在。
You didn't VirtualAlloc the memory block in the target process, so it isn't there.
为什么不使用其中一个辅助API来获取这个信息的跨进程,而不是使用极端的hackery。例如,UIA下载到XP并支持:
Instead of using extreme hackery to try to get this, why not use one of the accessibility APIs to get this info cross-process. UIA, for example, goes down to XP and supports this:
http://msdn.microsoft.com/en-us/library/ms726294(VS.85).aspx
Martyn
这篇关于来自sysListView32树的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文