I can successfully send any single key message to an application, but I don\'t know how to send combinations of keys (like Ctrl+F12, Shift+
If you want to simulate keystrokes to minimized windows you can do something like this:
uint windowThreadId = GetWindowThreadProcessId(hwnd, IntPtr.Zero);
uint myThreadId = GetCurrentThreadId();
AttachThreadInput(myThreadId, windowThreadId, true);
Next step is to use GetKeyboardState function to retrieve an array of all keys states of the window thread. Modify the state of SHIFT or CTRL or ALT keys to being pressed using their virtual key codes. Then call SetKeyboardState to apply these states. Press the F12 key:
SendMessage(hwnd, WM_KEYDOWN, Keys.F12, 0);
SendMessage(hwnd, WM_KEYUP, Keys.F12, 0);
Modify back the states of SHIFT, CTRL or ALT keys as being released. Call SetKeyboardState again. Finally, detach from window thread:
AttachThreadInput(myThreadId, windowThreadId, false);