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
public
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) 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, @KeyboardHook, HInstance, 0);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
UnhookWindowsHookEx(WHookKeyboard);
end;
end.
Saludos.