of course this will only work on windows. I don't think the window managers on other targets have such control ?
In any case, you need to acquire the window handle of the other process you wish to send messages to.
I suppose if you use some sort of unique window search like EnumWindows or FindWindow etc, you could comeup with something..
Simple example
PostMessage(theRemoteWindowHandle, TheMessageTOSend, Param1, Param2);