Dear all,
We recently replaced the traditional file menu by a UltraToolbarsManager control in our desktop application and everything works well -- except when we found out one issue that needs to be addressed.
When we use Remote Desktop and run our desktop application, Disconnecting the remote session and THEN reconnecting will cause the desktop application close. It happens when the reconnect happens ( we have code to check and confirmed the app is still running after disconnect ).
Some clues:
Any idea how we can find out what is causing the issue? Thanks very much in advance.
-- Alex
One more finding is that, if the main application is launched as mainform.ShowDialog(), it breaks. If it is launched via Application.Run( mainform ) then no crash happens.
Hello Alex,
Is the form closing or minimizing?
When closing out a remote connection to a server operating system. The OS turns off the themes service. As such, our components are notified of the themes change. When it receives this notification, the UltraToolbarsManager (due to its use of the Desktop Window Manager to render aero glass) must force the host form to recreate it's window handle.
The duplication of the form caption and the windowstate change of child forms, is a bug in the framework; not our components. I've attached a sample (without our controls) that demonstrates this. Simply run the application and click the button; You will see the child form now has a Normal state, and the caption is duplicated.
Please adjust the sample to tailor to your application and see if it's the exact issue. Let me know if you have any questions.
5270.WindowsFormsApplication1.zip
Hi Michael,
Thank you very much for the valuable information. This is exactly what is happening ( i.e. Winform handle change ).
We are embedding a 3rd party exe within an infragistic Panel using window's SetParent() based on the win form's handle as one of the arguments. With the handle refresh after remote desktop reconnect, the embedded application terminates and leave the win form in an unknown state.
Is there anything that we can retain the win form handle? Or is there any reference from Microsoft that we can look for alternatives?
Thanks very much for your help.
Since we do not control the theme services and this is handled by the OS there isn't much we can assist with unfortunately. There are several unknown issues revolving around OS which we cannot fix. There is a similar discussion on social.technet.microsoft.com
Let me know if you have any further questions regarding this matter.
Your component crashed when RDP reconnected. and you say that is not your problem. Joke ?
Please check this forum post where the same issue were discussed.
Here is what happens when you disconnect from remote desktop. When using remote desktop, the OS recognize the connection and changes the OS theme to disable Aero (glass). UltratoolbarsManager listens for this change, which is broadcasted to all windows when Aero is enabled/disabled. When the Aero is enabled, we would force the form to recreate it's handle and be able to render the glass frame correctly. Unfortunately, the .NET Framework causes modal forms to close when it recreates its handle.
This is exactly what Michael described in his answer. Also, he has attached a sample with no Infragistics, where the issue is still reproducible.
As you can see there is nothing we can fix here. The issue is in .NET and not in our components and there is no way to workaround this.