S
sury9
Unregistered / Unconfirmed
GUEST, unregistred user!
打开qq音乐之后有个播放列表和随便听听,用spy++显示该控件为SysListView32找遍百度和谷歌,也找遍大富翁,结果找到刘麻子兄弟的代码,但是结果依然是取不到指定行数的指定歌曲和歌手,请高手指正,谢谢 代码如下function ListView_GetItemText_Ex(hwndLV: HWND; i, iSubItem: Integer; pszText: PChar; cchTextMax: Integer): Integer;var LVItem: TLVItem; ProcessID, ProcessHD, Temp: DWORD; MemPoint: Pointer;begin GetWindowThreadProcessId(hwndLV, ProcessID); ProcessHD := OpenProcess( PROCESS_VM_OPERATION or PROCESS_VM_READ or PROCESS_VM_WRITE, FALSE, ProcessID); MemPoint := VirtualAllocEx(ProcessHD, nil, SizeOf(TLVItem) + cchTextMax, MEM_COMMIT, PAGE_READWRITE);lvitem.state:=LVIS_SELECTED;lvitem.stateMask:=LVIS_SELECTED;WriteProcessMemory(ProcessHD, MemPoint,@LVItem,SizeOf(TLVItem), Temp);SendMessage(hwndLV, LVM_SETITEMSTATE,i, Integer(MemPoint)); VirtualFreeEx(ProcessHD, MemPoint, SizeOf(TLVItem) + cchTextMax, MEM_DECOMMIT); VirtualFreeEx(ProcessHD, MemPoint, 0, MEM_RELEASE);end;procedure TForm1.Button6Click(Sender: TObject);var TextBuffer: array[0..100] of Char;begin ListView_GetItemText_Ex($30AD4,10, 1, TextBuffer, 100); ShowMessage(TextBuffer);end;end.