if(program.exe is running and has active window)
switch to active window (or bring it to the front)
if(program.exe is running && minimized in tray)
untray application and bring to front
else (program is not running)
launch executable // which is default behavior for pinned things in task-bar