标签:ext ges phi let 字符串 graphic const user string
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; const MW_MYMSG = WM_USER + 1; type TFormFF = class(TForm) Edit1: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } procedure WmMyMsg(var Msg: TMessage); message MW_MYMSG; end; var FormFF: TFormFF; implementation {$R *.dfm} procedure TFormFF.Button1Click(Sender: TObject); var wParam: Word; begin //创建原子 wParam := GlobalAddAtom(‘eng汉字‘); //发送 PostMessage(Handle, MW_MYMSG, wParam, 0) end; procedure TFormFF.WmMyMsg(var Msg: TMessage); var a: array[0..254] of Char; wa: Word; cmd: string; begin //获取原子名称 GlobalGetAtomName(Msg.WParam, @a, 255); //释放系统资源 DeleteAtom(wa); Edit1.Text := a; end; end.
通过GlobalAddAtom,GlobalGetAtomName方式发送字符串
标签:ext ges phi let 字符串 graphic const user string
原文地址:https://www.cnblogs.com/onlyou13/p/10962070.html