I need badly to send keystrokes to Windows Media Encoder 9, when it is minimized (meaning the window is not active).
WME is a great program for streaming to a Windows Media Server, but it is a bit unstable for continuous encoding, that is it stops encoding due to some strange errors. Its not our subject here to analyze them.
The fact is that when pressing the START ENCODING button (hotkey: Ctrl+Shift+E), the encoder starts encoding again without a problem. We cant afford to pay a human to watch the streaming process all the time if something happends.
I made a simple utility which it sends Ctrl+ShifT+E every one minute, even the encoder encodes OK (the WME has no problem if it accepts the hotkey even when is broadcasting). So we are ok if the process stops: in a minute the utility sends the right hotkey and the process starts ok.
This works, but the computer has to do some more stuff, meaning I cant have the WME window open and active all the time.
I read about SendMessage, and I've tried ANY example I've found on the internet
I also tried an example I've found of searching all the child controls in WME's parent window. The loop returns only the scroll bar! So I cant find the button "Start Encoding" in order to send a button click on that control.
Re: use sendmessage api as sendkey to inactive window
Thank you for the recommendation, I didnt know that there is a SDK for WME. I must do a research on that.
I still want to know, anyway, if there is a way to send a keystroke (combined or not) to an inactive (minimized or gray) foreign application. I 've tried SendMessage with NotePad too, the same behavior (does nothing). Maybe I am doing something wrong (see my first post code example).
In old days I loved to use DDE protocol builted in Microsoft Apps, but nowadays DDE is totally ignored (and I think not supported by the OSes anymore) and for sure WME knows nothing about it..