Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #9  
Antiguo 21-10-2010
Avatar de escafandra
[escafandra] escafandra is offline
Miembro Premium
 
Registrado: nov 2007
Posts: 2.210
Poder: 22
escafandra Tiene un aura espectacularescafandra Tiene un aura espectacular
Efectivamente, el sistema de capturar HotsKeys en Win 7 no funciona con ALT+TAB. Pero si funciona un Hook al teclado como el de este ejemplo que he preparado:

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
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  WHookKeyboard: cardinal;

implementation

{$R *.dfm}
function KeyboardHook(Code, wParam, lParam: Integer): Integer; stdcall;
begin
  if (Code = HC_ACTION) and LongBool(PDWORD(lParam + 8)^ and $20{LLKHF_ALTDOWN}) and (PDWORD(lParam)^ = VK_TAB) then
  begin
      Beep();
  end;
  Result:= CallNextHookEx(WHookKeyboard, Code, wParam, lParam);
end;



procedure TForm1.FormCreate(Sender: TObject);
begin
 WHookKeyboard:= SetWindowsHookEx(13{WH_KEYBOARD_LL}, @KeyboardHook, HInstance, 0);

end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnhookWindowsHookEx(WHookKeyboard);
end;

end.

Saludos.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Capturar las teclas presionadas lfb C++ Builder 6 27-09-2010 08:40:57
Capturar todas las teclas. rauros API de Windows 4 17-09-2008 09:43:07
Capturar teclas en form ivanloco Varios 3 21-07-2008 12:10:25
Problemas al capturar teclas Dexter182 Varios 2 09-10-2005 22:36:12
Capturar teclas en edit sur-se OOP 10 16-07-2004 13:25:17


La franja horaria es GMT +2. Ahora son las 14:43:45.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi