What I have done is change screens on successful login. In other words, you can put Login function button with the name of your chosen screen, when pressing that button login & logout screen would pop out and on successful login your current window will change.
macro_command main()
bool In = true
bool Off = false
bool Out = true
short ligin
short newWindowNumber
GetData(ligin, "Local HMI", LW_Bit, 895100, 1)
GetData(In, "Local HMI", LB, 0, 1)
GetData(Out, "Local HMI", LB, 1, 1)
//895100
if ligin == 1 and In then
newWindownumber = 12
SetData(newWindowNumber, "Local HMI", LW, 9050, 1)
SetData(Off, "Local HMI", LB, 0, 1)
end if
if ligin == 1 and Out then
ligin = 0
SetData(ligin, "Local HMI", LW_Bit, 895100, 1)
SetData(Off, "Local HMI", LB, 1, 1)
end if
end macro_command
That's my code for changing windows on successful login. I'm using "ligin" instead of "login". But there are some things you need to do.
First of all - find your "Login & Logout" window, mine is number 70 in EBpro. Open that Option List's Properties.

Put those settings. Then, open
Login and
Logout buttons. On both enable Notifications -> "
Set on" and "
Before writing". Login button address should be LB-0, Logout LB-1.
Logic
Periodical execution is set to 100ms.
"ligin" is LW_895100 - 1 is being written into it if login is successful.
I'm just watching over the logins. If one is successful -
"ligin" == 1 and "Login" button has been pressed - I change window. If not, nothing happens. On logout I write 0 in "ligin" to reset it.
I've done that months ago and stopped when I saw it's working since my current project don't require that logic.
I'm open to smarter ideas and I hope my work helps you!