You can't have a single-instance program which simultaneously shows windows on multiple terminal services sessions, or communciates using windows messages with other sessions.
If your question is, how can you ensure that your program only communicates with applications in the same session, the answer is you don't need to do anything.
Each Windows program is restricted to using Windows USER32 functions on a single session, so PostMessage will only send messages to windows in the same session.
Note that a single session can host processes belonging to different users - that's what the "Run As" functionality does. There are some restrictions on those processes communicating with each other though.
If your question is, how to allow a single instance of the program to be used simultaneously by users in different sessions, the answer is you must split your process into two.
A Service, and Client applications which run for each user in their own session. I would recommend the client activate and communicate with the service using DCOM. This can be a two-way channel so the service can send commands to the client applications too, once the communication is set up.