Application Event써서 Keyboard 받아내기 | |||
| |||
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, AppEvnts, OleCtrls, SHDocVw; type TForm1 = class(TForm) Button1: TButton; ApplicationEvents1: TApplicationEvents; WebBrowser1: TWebBrowser; procedure Button1Click(Sender: TObject); procedure ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin SetForegroundWindow( THandle(nil)); end; procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin if Msg.message=WM_KEYDOWN then begin if Msg.wParam=38 then begin Button1.Caption := 'UP!'; end else begin Button1.Caption := IntToStr(Msg.wParam); end; WebBrowser1.SetFocus; end; end; procedure TForm1.FormShow(Sender: TObject); begin WebBrowser1.Navigate( 'http://yahoo.co.kr'); end; end. Tags: 윈도우즈 | |||
| |||
| |||
Login for comment |