A ver si esto te resulta útil:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, AppEvnts;
type
TForm1 = class(TForm)
ApplicationEvents1: TApplicationEvents;
procedure ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
private
public
end;
var
Form1: TForm1;
lEscape : Boolean;
implementation
{$R *.dfm}
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
begin
Handled := False;
if (Msg.Message = WM_KEYDOWN) then
BEGIN
if Msg.wParam = VK_ESCAPE then
Begin
lEscape := True;
Handled := True ;
Exit;
End;
if (Msg.wParam = VK_F4 ) And lEscape then
Begin
lEscape := False;
Handled := True ;
ShowMessage('Se ha pulsado la combinación correcta');
End;
END;
end;
end.
Código:
object Form1: TForm1
Left = 359
Top = 278
Width = 299
Height = 190
Caption = 'Demostración de pulsacion de teclas'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object ApplicationEvents1: TApplicationEvents
OnMessage = ApplicationEvents1Message
Left = 96
Top = 48
end
end