delphi GetMem(myString,1024);//开辟1024个字节FreeMem(myString,1024);//释放


本文整理自网络,侵删。

 
procedure TForm1.Button4Click(Sender: TObject);
var
  myString:PChar;
Begin
  //SetLength (S1, 100);
  //GetWindowText (Handle, PChar (S1), Length (S1));
  //Button1.Caption := S1;

  GetMem(myString,1024);//开辟1024个字节

  GetWindowText (Handle, myString, 100);
  Button4.Caption :=format('%s:%d',[myString,strlen(myString)]);
  
  FreeMem(myString,1024);//释放
end;

相关阅读 >>

Delphi第三方控件通用安装方法

Delphi getmem(mystring,1024);//开辟1024个字节freemem(mystring,1024);//释放

Delphi �o置系�y�r�g

Delphi 禁用tedit右键菜单及复制粘贴

Delphi 中showmodal与show的区别

Delphi createprocesswithlogonw用法

Delphi 执行一个外部程序,当外部程序结束后言主程序立即响应

Delphi 如何让scrollbox的内容与滚动条一起实时滚动

Delphi 删除动态数组的指定元素

Delphi 如何在toolbar中的toolbutton上显示文字

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...