http://stackoverflow.com/questions/616584/how-do-i-get-the-name-of-the-current-executable-in-c