我想能夠選擇在另一個程序的列表視圖中選擇哪個項目(我沒有訪問其代碼)。實際上,它是一個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);
不是真的:LVM_SETITEMSTATE指定項目的狀態將被更改。對於此消息,.mask被忽略。 – Rom 2009-07-01 06:59:58