Hello, I am creating a login window that starts with the main window, but I am not able to make the two windows close by a button and the "X" of each window, follow the test project, I need to close in the two windows by the button and the "X"

I found the problem would be the internetbank security application is blocking to exit, I managed to solve it leaves in compatibility mode windows xp, I do not know why the security application blocks by the button only