Ver Mensaje Individual
  #3  
Antiguo 24-02-2024
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.203
Reputación: 20
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Quizás te interese revisar la API RegisterHotKey
Te dejo un ejemplo:
Código Delphi [-]
unit Unit1;


interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    procedure HotKey(var Message: TMessage); message WM_HOTKEY;
  public

  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

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

procedure TForm1.HotKey(var Message: TMessage);
var
  MousePos: TPoint;
begin
  case Message.WParam of
    111: ShowMessage('Se Pulsó ImprPant');
  end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   UnregisterHotKey(Handle, 111);
end;

end.


Saludos.
Responder Con Cita