How to restart or close windows using winAPI