急!怎么得到其他程序 listview控件的列标题?(300)

I

iKing

Unregistered / Unconfirmed
GUEST, unregistred user!
网上能找到 “提取其他程序ListView控件中某个Item的内容”,没看见有提取列标题的。
 
进程间通讯。
 
在你程序中放一个Timer,其中写如下代码,移动鼠标到其他进程窗口,即可获得任何进程里面任何窗口句柄、类名和窗口文字:procedure TFormClassNameFinder.Timer1Timer(Sender: TObject);var aWnd: HWND; aBuf: array [0..254] of char;begin aWnd:= WindowFromPoint(Mouse.CursorPos); edt_Handle.Text:= IntToStr(aWnd); GetWindowText(aWnd, aBuf, 255); edt_Caption.Text:= aBuf; GetClassName(aWnd, aBuf, 255); edt_ClassName.Text:= aBuf; //ESC Key pressed to stop timer. if GetKeyState(VK_ESCAPE) < 0 then begin Timer1.Enabled:= false; Button1.Enabled:= true; end;end;获得窗口句柄之后再结合FindWindowEx、GetWindowText函数就可以得到Item的内容了。
 
多人接受答案了。
 

Similar threads

顶部