I need to be able to switch between two third-party applications based on the input from a COM port, i.e. when I receive Command1
from the device, make App1 the active (topmost) window, and when I receive Command2
from the device, make App2 the active window. Why do I want to do this? This application will be running on a self-service station and I will be monitoring the input of a motion sensor; so when nobody is in front of the station I need to show App2 (e.g. advertisement) and when someone stands in front I need to show App1 (e.g. main application).
I am thinking of an application that runs in the background and listens to the input on the COM port and switches the active window accordingly. So the question is, how can I change the active window using .NET? The OS will be Windows XP Pro SP2, but it would be better if it works on Windows 7 too.