I WILL STATE THE SITUATION.
Suppose i want to create an application named APP1. It must have some provision to capture the window ID of all other running programs in current Screen( like user may run nautilus ,Firefox, gEdit ot terminal etc...).Now from this APP1 we can activate or deactivate or even minimize and maximize all these opened programs .

NOTICE: APP1 and other running applications are isolated....