I have an application with Hotkeys installed. when the hotkey is pressed, the application comes to the topmost, or bottommost z-order. I have used SetwindowPos api. The problem, however, is that in as much as the window is the topmost, it is not active, so it does not receive input. The machine I'm using does not have a mouse or a conventional keyboard for me to to Alt+Tab.
I have tried to send mouse_events api to simulate a click on the window to activate it, to no avail. I have therefore ran out of Ideas. How can I do this?

if you know the caption / title of the window you can try this: appactivate "title of window here"

Yyyep!! That worked. AppActivate. Thanks.