Hook del teclas
#1
Escrito 23 junio 2010 - 01:28
saludos
#2
Escrito 23 junio 2010 - 02:05
unit Unit4; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; const ID_HOTKEY = 100; type TForm4 = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } procedure WMHOTKEY(var Msg: TMessage); message WM_HOTKEY; public { Public declarations } end; var Form4: TForm4; implementation {$R *.dfm} procedure TForm4.FormCreate(Sender: TObject); begin RegisterHotKey(Handle,ID_HOTKEY,MOD_CONTROL,Ord('K')); end; procedure TForm4.WMHOTKEY(var Msg: TMessage); begin case Msg.WParam of ID_HOTKEY: ShowMessage('Hola'); end; end; end.
Para mas información busca en la ayuda RegisterHotKey y WM_HOTKEY
#3
Escrito 23 junio 2010 - 02:43
#5
Escrito 13 julio 2016 - 07:16
Informacion adicional para este tema. Ya se que el Hilo es Viejo...
Hooking into the Windows API is a complicated process and there are several techniques to achieve this. Microsoft recommends that the callback procedure for most hooks should reside within a DLL, this is the method used by the TCPKeyHook Component. The Component encapsulates the procedures and functions within the separate DLL and uses Memory Mapped File (MMF) to send a custom message with the keyboard information to the calling application or process. The result is a system wide hook into all global keyboard events generated by the user keyboard input.
http://torry.net/vcl...eys/keyhook.zip
Saludos!
Si te sirvio de algo la Informacion. Te agradeceria un click en Gracias!