GetWindowText 通常是与 SetWindowText 配合使用的。<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> TheText: PChar;<br> TextLen: Integer;<br>begin<br> TextLen:=GetWindowTextLength(Form1.Handle);<br> GetMem(TheText,TextLen);<br> GetWindowText(Form1.Handle,TheText,TextLen+1);<br> Edit1.Text:=string(TheText);<br> FreeMem(TheText);<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> SetWindowText(Form1.Handle, PChar(Edit1.Text));<br>end;