My application is making some RPC connections to Windows services. When the application is closed by exit button( X mark on the right corner of the Application Window)y. All the connections are ended properly. And the next time you can launch the application successfully.
In case if application is terminated abruptly ( if i kill the application in the task manager or if i log off when the application is still running), the RPC connections are not ended properly. When i launch the application again i get error as RPC connection still in use.
So what is the Windows messgae where i can close all the connections when applications is terminated abruptly ? Please not that WM_DESTROY message is not getting called when i kill the application