Update main.cpp

Part where treefrog executes as Windows service was changed according MSDN specification.