WindowMovedOrResized Event (ActiveX)

Triggered just after the application or drawing window has been moved or resized.

Supported platforms: Windows only

Signature

VBA:

object.WindowMovedOrResized(HWNDFrame, bMoved)
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.

HWNDFrame

Type: Long_PTR; input to the handler

The application or document window frame.

bMoved

Type: Boolean; input to the handler

  • True: The window was moved.
  • False: The window was resized

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_WindowMovedOrResized(ByVal HWNDFrame As LONG_PTR, ByVal bMoved As Boolean)
    ' This example intercepts a drawing WindowMovedOrResized event.
    '
    ' This event is triggered when the drawing window is moved or resized
    '
    ' To trigger this example event: Move or resize the drawing window

    Dim CurrentState As String

    ' Use the "bmoved" variable to determine if we moved or sized the drawing window
    CurrentState = IIf(bMoved, "Moving", "Sizing")

    MsgBox "The drawing window appearance was changed by: " & CurrentState
End Sub

Visual LISP:

Not available