我希望能够选择在另一个程序的列表视图中选择了哪个项目(我无权访问它的代码)。实际上,它是一个 SysListView32,我认为它是相同的。我已经有以下代码,不幸的是,尽管编译,但似乎什么也没做(尽管 SendMessage() 返回 1)。
process=OpenProcess(PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, 0xD14);
_lvi=(LVITEM*)VirtualAllocEx(process, NULL, sizeof(LVITEM), MEM_COMMIT, PAGE_READWRITE);
lvi.state = LVIS_SELECTED | LVIS_FOCUSED;
lvi.stateMask = LVIS_SELECTED | LVIS_FOCUSED;
WriteProcessMemory(process, _lvi, &lvi, sizeof(LVITEM), NULL);
int abc = ::SendMessage((HWND)0x00050D30, LVM_SETITEMSTATE, (WPARAM)2, (LPARAM)_lvi);
VirtualFreeEx(process, _lvi, 0, MEM_RELEASE);