Hello, Biswajit.
I'm not sure that I understood your requirement correctly. But let me describe what I know.
Standard Logon button is handled in javascript. It's right. But it's the same for all buttons in the toolbar.
The javascript code does some stuff. But the actual processing starts on the backend. In ABAP in other words.
Particularly, Logon procedure starts in CL_MCM_CLIENT_EVENT_LISTENER->DISPATCH_MESSAGE method.
From
* #topic=com.sap.ic.mcm.logon ELSEIF icwc_eventname = icwc_mcm_user_logon.
As you can see the procedure continues in CL_ICCMP_CCS->CMS_LOGIN. And after that in CL_CRM_IC_MCM_SESSION_PROXY=>DO_CCLOGIN.
Here the login to CMS takes place. And there is some messages are added in javaerrorhandler( ref_jexception ). For example, message number 060 from message class CRM_IC_APPL_UI_CHMSG in case of the failed attempt (which sounds like "Cannot log on to communication management software system").
So the message is not enough and you want to provide a popup? Am I right? Let's go back and look at CL_MCM_CLIENT_EVENT_LISTENER->DISPATCH_MESSAGE. There is an event right after CL_ICCMP_CCS->CMS_LOGIN call. I would try to subscribe to this "client_user_state_message" event (for instance, CL_CRM_MCM_SESSION already does this), then analyze the message in my own listener and in case of 'login' message and ping failed situation I would try to create a popup.
Hope this will help you.
If I misunderstood you, please correct me.