Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 팁&트릭
Delphi Programming Tip&Tricks
[34] Application의 모든 윈도우 메세지 모두 받기
장인수 [textout] 7519 읽음    2002-10-12 16:07
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    Str: string;
  public
    { Public declarations }
    procedure AppOnMessage(var Msg: TMsg; var Handled: Boolean);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.AppOnMessage(var Msg: TMsg; var Handled: Boolean);
begin
  with Msg do
  begin
    case Msg.message of
      WM_CHAR:
      begin
        Str := Str + Char(wParam);
        Canvas.TextOut(10,10, Str);
      end;
    end;
  end;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  // 윈도우 메세지가 있으면 AppOnMessage 실행하게 한다.
        Application.OnMessage := AppOnMessage;
end;

end. 

+ -

관련 글 리스트
34 Application의 모든 윈도우 메세지 모두 받기 장인수 7519 2002/10/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.