유돌이

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Notice

2010. 1. 11. 14:34 델파이

간단한 예제로 설명 할게요.

 

아래의 예제는 'F10'키를 HotKey로 등록하여

'F10'키가 눌리면 해당 프로그램이 종료가 되도록 코딩하였습니다.

 

//선언부

 procedure WMHotkey(var msg: TWMHotkey); message WM_HotKey;

 

 

//구현부

procedure TForm1.WMHotkey(var msg: TWMHotkey);
begin
  case msg.HotKey of
    1:
    begin
      OutPutDebugString('Program Exit');
      Form1.Close; // F10
    end;
  end;
end;

 

procedure TForm1.FormCreate(Sender: TObject);
begin
    RegisterHotKey(Handle, 1, 0, VK_F10);
end;

 

이상 간단한 팁이 였습니다. ㅋㅋ

posted by 유돌이