现在位置:主页>系统编程> 文章内容

得到某个文本框的内容

我要投稿更新日期:2008-07-02 点击:

function Getcaption(hWnd:longword):string;
var
szwindowText:array[0..MAX_PATH] of char;
szTextLength:integer;
begin
szTextLength:=SendMessage(hWnd,WM_GETTEXT,MAX_PATH,integer(@szWindowText[0]));
szWindowText[szTextLength]:=#0;
Result:=szWindowText
end;
function Get_use:string;
var
main,edit_text:THandle;
begin
result:='';
main:=findwindow('',nil);
if main=0 then exit;
edit_text:=findwindowEx(main,THandle(nil),'',nil);
if edit_text=0 then exit;
result:=Getcaption(edit_text);
end;


-



所有评论

评论列表


我也评论来评论! 点击此处参与本文评论

注意:本站采用匿名评论,请各位网友注意自己的言行