Detect if we were double-clicked.
Because we are compiled as a console subsystem application, if the user
double-clicks the executable it will pop up a new console window. Then,
since no arguments were passed, we will dump a usage message which the
user won't have time to read, and exit.
We now detect this situation and redirect the usage message to a popup.
There are three likely cases to handle.
If we are running in a service context there won't be a console window.
GetConsoleWindow() will return a null handle.
If were launched from a command window, the process ID owning the
console handle will be different from as our process ID.
If the process IDs are the same, we were started with a new console. We
call FreeConsole() to close it and subsequently direct the usage message
to a message box.