您的位置:首页 > 编程语言 > Delphi

Delphi 自定义消息 处理字符串

2014-01-15 16:07 369 查看
unit Unit1;

interface

uses

  Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms,

  Dialogs, StdCtrls;

const

  WM_aaa = wm_user + 200;

type

  TForm1 = class(TForm)

    Button1:
TButton;

    Edit1:
TEdit;

    procedure
Button1Click(Sender: TObject);

  private

    { Private
declarations }

  public

    { Public
declarations }

    procedure
aaa(var msg: TMessage);message WM_aaa;

  end;

var

  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.aaa(var msg: TMessage);

begin

 
ShowMessage(PChar(msg.LParam));

end;

procedure TForm1.Button1Click(Sender: TObject);

var

 Caption1:array[0..255]of char;

 sCaption :string;

begin

    //
sCaption:=strpas(PChar(Caption1));

   
SendMessage(self.Handle,WM_aaa,0,integer(PChar(Edit1.Text)));

end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: