WindowChanged Event (ActiveX)

Triggered when there is a change to the application or document windows.

Supported platforms: Windows only

Signature

VBA:

object.WindowChanged(WindowState)
object

Type: Application, Document

An object expression that evaluates to a valid container object. In this case, the only valid containers are the application and a document.

WindowState

Type: Integer; input to the handler.

  • acMin - The window is minimized.
  • acMax - The window is maximized.
  • acNorm - The window is normal (neither minimized nor maximized).

Remarks

This event is helpful when implementing toolbars or modeless dialog boxes that track with the application or document window. The VB or ObjectARX application can use the HWNDFrame parameter to get the coordinates of the window, convert those coordinates to either screen or parent coordinates, and use this information to position other windows.

No events will be fired while a modal dialog is being displayed.

Examples

VBA:

Private Sub AcadDocument_WindowChanged(ByVal WindowState As Long)
    ' This example intercepts a drawing WindowChanged event.
    '
    ' This event is triggered when the window state of the
    ' current drawing window is changed.
    '
    ' To trigger this example event: Change the window state of the drawing window
    '
    ' For example: Minimize or maximize the drawing window

    Dim CurrentState As String

    ' Use the "WindowState" variable to determine the new drawing window state
    Select Case WindowState
        Case acMin: CurrentState = "Minimized"
        Case acMax: CurrentState = "Maximized"
        Case acNorm: CurrentState = "Normal Size"
    End Select

    MsgBox "The drawing window is now: " & CurrentState
End Sub

Visual LISP:

Not available