http://www.delphibbs.com/delphibbs/dispq.asp?lid=3138049<br>这个太复杂了<br>这段代码原贴在<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2471980<br><br><br>//SetLVItemText: 修改其他进程中ListView的节点的Text<br>//有几个函数没有检查返回值,在实际应用时最好加上<br>//hListView: ListView的Handle<br>//iIndex : 要修改的ListView的节点索引(0为第一个...)<br>//sNewText : 要修改成的文本<br>procedure SetLVItemText(const hListView: HWND; const iIndex: Integer; const sNewText: String);<br>var<br> hli: TLVItem;<br> Buff: PChar;<br> PID: THandle;<br> PRC: THandle;<br> R: Cardinal;<br>begin<br> GetWindowThreadProcessId(hListView, @PID);<br> PRC := OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ or PROCESS_VM_WRITE, False, PID);<br> Buff := VirtualAllocEx(PRC, nil, 4096, MEM_RESERVE or MEM_COMMIT, PAGE_READWRITE);<br><br> FillChar(hli, sizeof(hli), 0);<br> hli.mask := LVIF_TEXT;<br> hli.pszText := PChar(integer(Buff) + SizeOf(hli) * 4);<br> hli.cchTextMax := Length(sNewText)+1;<br> <br> WriteProcessMemory(PRC, Buff, @hli, Sizeof(hli), R);<br><br> WriteProcessMemory(PRC, PChar(integer(Buff) + SizeOf(hli) * 4), PChar(sNewText), Length(sNewText)+1, R);<br> <br> SendMessage(hListView, LVM_SETITEMTEXT, iIndex, LongInt(Buff));<br><br> VirtualFreeEx(PRC, Buff, 0, MEM_RELEASE);<br> CloseHandle(PRC);<br>end;<br> <br>这个函数只能修改listview的结点text,怎样修改这段代码能使其能修改listview以report形式存在的任意行任意列,即任意单元格的text?<br>独帅路过回答,本人感激不尽!