Registrando HotKeys:
Código PHP:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <vcl\Clipbrd.hpp>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
RegisterHotKey(Handle, 67, MOD_CONTROL, 67);
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// Procesamos los mensajes a bajo nivel
void __fastcall TForm1::WndProc(Messages::TMessage &Message)
{
if(Message.Msg == WM_HOTKEY)
if(Message.WParam == 67) Clipboard()->Clear();
TForm::WndProc(Message);
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
UnregisterHotKey(Handle, 67);
}
//---------------------------------------------------------------------------
Saludos.