Код | procedure TForm1.Button2Click(Sender: TObject); var Wnd: HWND; I, Amount: Integer; buf: array [0..255] of Char;
PID, ProcessHandle, Dummy: DWORD; PCh: PChar; PItem: ^LV_ITEM; Item: LV_ITEM; begin Wnd := FindWindow('DV2ControlHost',nil); Wnd := FindWindowEx(WND,0,'DesktopSFTBarHost',nil); Wnd := FindWindowEx(WND,0,'SysListView32',nil);
GetWindowThreadProcessID(Wnd, @PID); ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, False, PID);
PCh := VirtualAllocEx( ProcessHandle, nil, 255, MEM_COMMIT, PAGE_EXECUTE_READWRITE ); PItem := VirtualAllocEx( ProcessHandle, nil, SizeOf(LV_ITEM), MEM_COMMIT, PAGE_EXECUTE_READWRITE );
Amount := ListView_GetItemCount(Wnd); for I := 0 to Amount do begin
Item.mask := LVIF_TEXT; Item.iItem := I; Item.iSubItem := 0; Item.pszText := PCh; Item.cchTextMax := SizeOf(buf);
WriteProcessMemory(ProcessHandle, PItem, @Item, sizeOf(Item), Dummy); if ListView_GetItem(Wnd, PItem^) then begin
ReadProcessMemory(ProcessHandle, PCh, @buf, 255, Dummy); memo2.Lines.Add(buf); // Test
end; end;
VirtualFreeEx(ProcessHandle, PCh, 0, MEM_RELEASE); VirtualFreeEx(ProcessHandle, PItem, 0, MEM_RELEASE);
CloseHandle(ProcessHandle); end;
|
Автор: http://vingrad.ru/@volvo877 Источник: http://forum.vingrad.ru/index.php?show_type=&showtopic= |