zoukankan      html  css  js  c++  java
  • Delphi自定义了一个消息 范例

    //自己定义了一个消息 范例
    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;

    const
      my_messagedisp=Wm_user+201;

    type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Button1: TButton;
        
    procedure Button1Click(Sender: TObject);
      
    private
        { Private declarations }
        procedure  mymesspro2(var mymess: TMessage); message  my_messagedisp;
      
    public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}
    procedure TForm1.mymesspro2(var mymess: TMessage);
    begin
         memo1.Lines.Add('无法读取相关参数');
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
      SendMessage(Form1.Handle,my_messagedisp,0,0); //测试通过
    end;

    end.

  • 相关阅读:
    An analysis of a simple Java basic interview question: short s1=1; s1 = s1 +1 will report an error?
    <bits/stdc++.h> in C++
    linux 下配置可视化git 冲突合并工具kdiff3
    加分
    对老师的意见和课程总结
    12月19日
    12月18日
    12月17日
    12月16日
    12月15日
  • 原文地址:https://www.cnblogs.com/tulater/p/1412927.html
Copyright © 2011-2022 走看看