I want to run the app in silent mode by passing in a parameter, otherwise I will show the window.
I think a better solution will be not creating the window if not needed. Take a look at the main function and you will see the code that creates the window. Call it only if you want to launch the window.