Yes but you have to set the parent/owner
For WPF use
Dim Win As New Window()
Dim WHlp1 As New Interop.WindowInteropHelper(Win)
WHlp1.Owner = commandData.Application.MainWindowHandle
For Forms use
Public Class RevitWindow
Implements IWin32Window
Public ReadOnly Property Handle As IntPtr Implements IWin32Window.Handle
Public Sub New(UIApp As UIApplication)
Handle = UIApp.MainWindowHandle
End Sub
End Class
Private Function Obj_XXa(ByVal commandData As Autodesk.Revit.UI.ExternalCommandData,
ByRef message As String, ByVal elements As Autodesk.Revit.DB.ElementSet) As Result
Dim RW As New RevitWindow(commandData.Application)
Dim Form1 As New Windows.Forms.Form
Form1.ShowDialog(RW)
Return Result.Succeeded
End Function