You can use the C windows API to achieve this.
Code
BOOL WINAPI RegisterHotKey(
_In_opt_ HWND hWnd,
_In_ int id,
_In_ UINT fsModifiers,
_In_ UINT vk
);
As well as
Code
LRESULT WINAPI SendMessage(
_In_ HWND hWnd,
_In_ UINT Msg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
);
First you would register a global hotkey for the specified window via using its HWND id and then every time the message queue receives the hotkey event you can call SendMessage() to send the key you wish to manipulate.