I have an application window which covers the screen and there are several minor tool windows which are hidden by default and their 'Owner' properties are set to this main window.
When I show a tool window and click one of its buttons it hides itself to show another window. When I hide that another tool window Windows switches app just like when you press alt+tab. The only way to prevent this is clicking on the main application window before closing (hiding) the tool window.
Why does the application switching happens and how to prevent this? Well I can tell explicitly those windows to bring the main window front on hide (I haven't tried that yet, but I don't like to do that.) This only happens when the Owner property is set on the that windows to prevent them from showing behind the main window.
ps: This full screen app is a game and those windows are the menus and the setting screens etc...