Visual C++ 6.0
#include <stdio.h>
#include <windows.h>
#include <commctrl.h>
#define MyFunc __stdcall
void MyFunc GetViewItem(HWND h, LPSTR pszString, int iRow) {
LVITEM lvitem;
char buffer[ 200 ];
DWORD pid = 0;
GetWindowThreadProcessId( h, &pid );
HANDLE hProcHnd = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pid );
LPVOID pLVI = VirtualAllocEx( hProcHnd, NULL, sizeof( LVITEM ),
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
LPVOID pBuffer = VirtualAllocEx( hProcHnd, NULL, 200,
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
lvitem.mask = 0;
lvitem.iItem = 0;
lvitem.iSubItem = 0;
lvitem.state = 0;
lvitem.stateMask = 0;
lvitem.pszText = ( char *)pBuffer;
lvitem.cchTextMax = 200;
lvitem.iImage = 0;
lvitem.lParam = 0;
DWORD copied = 0;
WriteProcessMemory( hProcHnd, pLVI, &lvitem, sizeof( LVITEM ), &copied );
SendMessage( h, LVM_GETITEMTEXT, (WPARAM)iRow, (LPARAM)pLVI );
ReadProcessMemory( hProcHnd, pBuffer, (LPVOID)buffer, 200, &copied );
VirtualFreeEx( hProcHnd, pBuffer, 0, MEM_RELEASE );
VirtualFreeEx( hProcHnd, pLVI, 0, MEM_RELEASE );
strcpy(pszString, buffer);
}