wmctrl

C++
sudo apt-get install wmctrl 
Source

Also in C++: