我只想取字符,不是什么密码

解决方案 »

  1.   

    给分!
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Hwnd1: HWND;
      pos1: TPoint;
      s: PChar;
    begin
      GetMem(s, 200);
      GetCursorPos(pos1);
      Hwnd1 := WindowFromPoint(pos1);
      if Hwnd1 <> 0 then
      begin
        GetWindowText(Hwnd1, s ,200);
        ShowMessage(String(s));
      end;
      FreeMem(s);
    end;
      

  2.   

    在98中可以,XP中怎么取不到啊如果能解决这个也可以:用Sendmessage发送到EDIT中就会将全部内容覆盖,所以我只能先取到原内容,再增加新内容一起发送