$ 0 0 You can put it in InitializeShell - create and show your login dialog from there, and don't do the two lines of code that set the main window and show it until after the login dialog is successfully completed.