public Form1() { InitializeComponent(); Resize += Form1_Resize; Load += Form1_Load; HOTKEY_ACTIVE += Start; FormClosing += Form1_FormClosing; Api.RegisterHotKey(Handle, 1, HotKey.FsModifiers.None, Keys.Tab); }
RegisterHotKey(Handle, 1, HotKey.FsModifiers.None, Keys.Tab);
void Form1_KeyDown(object sender, KeyEventArgs e) { MessageBox.Show(e.KeyCode.ToString()); if (e.KeyCode == Keys.Tab) { MessageBox.Show("OH!"); } } protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Tab) { object sender = Control.FromHandle(msg.HWnd); KeyEventArgs e = new KeyEventArgs(keyData); Form1_KeyDown(sender, e); return true; } return base.ProcessCmdKey(ref msg, keyData); }