You should use our standard login window (with Element type Login Control) and then after login you should redirect to your custom function.
Our built-in login mechanism will cover both customer and user login.
I would like to know what BackgroundHALShouldPause does, and how to use it. While it's listed in the HAL Primitives report, it is not used in source code and it doesn't appear in the LMS HAL...