Original Post
I want another program of mine to send "virtual" key press to another(an SDL program to be specific). I've been able to get SendInput to work, but it seems like a horrible hack. I'd like something that doesn't require the window be in focus, because all the functions to tell if a window is in focus(IsVisible,GetForegroundWindow) will report it is in focus even when still switching or drawing. I've tried sending messages to the handle with SendMessage/PostMessage, but that doesn't work at all. Does anyone know of a better way?