I came accross this post in Experts Exchange by BTecho while searching for application wide hotkeys, this is for CTRL + b for anything else change the MOD_CONTROL, and ord('c') to whatever you want:
//In the main form's OnCreate event
//assign the hotkey handler
If not RegisterHotkey
(Handle, 1, MOD_CONTROL , ord('C')) Then
ShowMessage('Unable to assign Ctrl+C as hotkey.');
//In the main forms OnClose event
//remove the hotkey handler:
UnRegisterHotkey( Handle, 1 );
//Add a handler for the
//WM_HOTKEY message to the form:
private // form declaration
Procedure WMHotkey( Var msg: TWMHotkey );
message WM_HOTKEY;
Procedure TForm1.WMHotkey( Var msg: TWMHotkey );
Begin
If msg.hotkey = 1 Then Begin
//now simulate alt+tab
keybd_event(Key, VK_MENU, 0, 0);
keybd_event(Key, VK_TAB, 0, 0);
keybd_event(Key, VK_TAB, KEYEVENTF_KEYUP, 0);
keybd_event(Key, VK_MENU, KEYEVENTF_KEYUP, 0);
End;