Ver Mensaje Individual
  #4  
Antiguo 14-08-2007
Avatar de ArdiIIa
[ArdiIIa] ArdiIIa is offline
Miembro Premium
 
Registrado: nov 2003
Ubicación: Valencia city
Posts: 1.481
Reputación: 22
ArdiIIa Va por buen camino
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
    { Private declarations }
  public
    { Public declarations }
  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
__________________
Un poco de tu generosidad puede salvar la vida a un niño. ASÍ DE SENCILLO
Responder Con Cita