How to play a sound or tone when a program ends?

Works on Windows.