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

  • 相关阅读:
    AutoMapper使用
    C#网络编程
    ASP.NET MVC (Razor)开发
    React的React Native
    WCF搭建
    异步编程
    Async和Await进行异步编程
    C#开发中使用配置文件
    NET转Java
    net 开源组件
  • 原文地址:https://www.cnblogs.com/hackpig/p/1668589.html
Copyright © 2011-2022 走看看