I have an application to which I want to send the Ctrl-C keys combination. I am trying with SendMesssage
, but I know that the application checks for Ctrl-C combination using GetKeyState
and GetAsyncKeyState
so SendMessage
is pretty useless... How can I send the Ctrl-C combination to this window without calling SetForegroundWindow(hWnd)
? I need a solution which works without focusing/bringing to front the window.
I am temporarily using this code (but requires focus):
SetForegroundWindow(hWnd);
SendKeys.SendWait("^(c)");
I am using C#, but C++ code is ok.