Revit Application hides in background after closing Add-in (modelles form)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have more than 1 add-in all showing this behavior:
The modelles Form is shown by the Idling Event, doing it's thing, but after closing the Fom the Revit Application is gone, hide in the background, lost it's focus.
I found this:
https://thebuildingcoder.typepad.com/blog/2017/10/modeless-form-keep-revit-focus-and-on-top.html
but is says:
This was written about 5 years ago.
As of the next major release of Revit, the method described there will no longer work.
An easy way to fix this will be provided. The Revit API will include new API calls providing an official way to get the application window handle:
- Get the handle of the Revit main window.
- Return the main window handle of the Revit application. This handle should be used when displaying modal dialogs and message windows to ensure that they are properly parented. This property replaces the System.Diagnostics.Process.GetCurrentProcess() MainWindowHandle property.
I use the MainWindowHandle from the UIApplication when calling the Show event of the Form, so the Form knows it's owner/parent. It's stays on top of Revit, so it is called correct, but still this behavior.
Because of the post from Jerremy ages ago, I thought I could find the solution on the internet, but can't find it.
Who can help me fix this annoying issue?
Thanks!!
Chris Hanschen
LKSVDD Architects, The Netherlands