HOla:
Ya ese post lo habia visto pero me da un error osea este es mi codigo:
-----------------------------------------------------------------------------
Código Delphi
[-]
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm2 = class(TForm)
protected
procedure WndProc(var Msg: TMessage); override;
private
public
end;
var
Form2: TForm2;
implementation
procedure TForm2.WndProc(var Msg: TMessage);
begin
if msg.msg = wm_hotkey then
begin
case msg.WParam of
0: Form2.Show; 1: Application.Terminate; end;
{$R *.dfm}
end;
end;
procedure TForm2.DecodeHotKey(shortcut: Tshortcut; var key: Word; var modif: Integer);
var
comb: String;
shiftkey: TshiftState;
begin
modif := 0;
shortcuttokey(shortcut, key, shiftkey);
comb := shortcuttotext(shortcut);
if pos('Shift', comb) <> 0 then
inc(modif, 4);
if pos('Ctrl', comb) <> 0 then
inc(modif, 2);
if pos('Alt', comb) <> 0 then
inc(modif, 1);
end;
procedure FormCreate;
var teclappal :word;
modificadores:integer;
begin
decodehotkey(hotkey1.hotkey, teclappal, modificadores);
registerhotkey(self.Handle, 0, modificadores, teclappal);
decodehotkey(hotkey2.hotkey, teclappal, modificadores);
registerhotkey(self.Handle, 1, modificadores, teclappal);
end;
procedure FormClose;
begin
unregisterhotkey(self.Handle, 0);
unregisterhotkey(self.Handle, 1);
end;
end.
Mi pregunta es me falta un libreria o un componente?
Si pudieran conlgarme un ejemplo sencillo se los agradeceria mucho, ya que no puedo hacer busquedas en internet, porque solo tengo acceso a este forum y al email.
Saludos y desde ya muchas gracias