Hook del teclas
#1
Posted 23 June 2010 - 01:28 PM
saludos
#2
Posted 23 June 2010 - 02:05 PM
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
Posted 23 June 2010 - 02:43 PM
#5
Posted 13 July 2016 - 07:16 PM
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!