UIControlledApplicationMainWindowHandle Property |
Get the handle of the Revit main window.
Namespace: Autodesk.Revit.UIAssembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic virtual IntPtr MainWindowHandle { get; }
Public Overridable ReadOnly Property MainWindowHandle As IntPtr
Get
public:
virtual property IntPtr MainWindowHandle {
IntPtr get ();
}
abstract MainWindowHandle : IntPtr with get
override MainWindowHandle : IntPtr with get
Property Value
IntPtr
RemarksReturns the main window handle of the Revit application. This handle should be used when displaying
modal dialogs and message windows to insure that they are properly parented. This property replaces
System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle property, which is no longer a reliable
method of retrieving the main window handle starting with Revit 2019.
See Also