zoukankan      html  css  js  c++  java
  • 覆盖Form.WndProc来响应消息

    1 

    源代码:

    unit Unit1;

    interface

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

    type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      protected
        procedure WndProc(var Message:TMessage);override;
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    { TForm1 }

    procedure TForm1.WndProc(var Message: TMessage);
    begin
      inherited;
      if Message.Msg = WM_LBUTTONDOWN then
        ShowMessage('WndProc');

    end;

    end.

    --------------------------------------------------------------

    界面代码:

    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 210
      ClientWidth = 310
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      PixelsPerInch = 96
      TextHeight = 13
    end

  • 相关阅读:
    进度条4
    构建之法读书笔记02
    进度条3
    个人作业四则运算2测试
    个人作业3
    从小工到专家阅读笔记01
    个人冲刺07
    个人冲刺06
    个人冲刺05
    学习进度条08
  • 原文地址:https://www.cnblogs.com/hackpig/p/1668589.html
Copyright © 2011-2022 走看看