Solid Edge Framework Type Library
ActiveWindow Property
Description
Returns the active Window object.
Property type
Read-only property
Syntax
Visual Basic
Public Property ActiveWindow As Object
Remarks
An active window is the window on top (the UI active window). If a Window is not open, ActiveWindow returns nothing.
Example
Imports SolidEdgeFramework
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()
        Dim objApplication As SolidEdgeFramework.Application = Nothing
        Dim obj3dWindow As SolidEdgeFramework.Window = Nothing
        Dim obj2dWindow As SolidEdgeDraft.SheetWindow = Nothing

        Try
            OleMessageFilter.Register()

            ' Connect to a running instance of Solid Edge.
            objApplication = Marshal.GetActiveObject("SolidEdge.Application")

            ' Try casting to a 3D Window
            obj3dWindow = objApplication.ActiveWindow

            ' Try casting to a 2D Window
            obj2dWindow = objApplication.ActiveWindow
        Catch ex As Exception
            ' Write any errors to console.
            Console.WriteLine(ex.Message)
        Finally
            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

Application Object  | Application Members