Specifies the state of the application or document window.
Supported platforms: Windows only
VBA:
object.WindowState
Type: Application, Document
The object this property applies to.
Read-only: No
Type: acWindowState enum
No additional remarks.
VBA:
Sub Example_WindowState()
    ' This example reads and displays the current window state of the AutoCAD application.
    Dim CurrentState As String
    
    ' Use the "WindowState" variable to determine the window state of AutoCAD
    Select Case WindowState
        Case acMin: CurrentState = "Minimized"
        Case acMax: CurrentState = "Maximized"
        Case acNorm: CurrentState = "Normal Size"
    End Select
    ' Display window state
    MsgBox "AutoCAD is now: " & CurrentState
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_WindowState()
    ;; This example reads and displays the current window state of the AutoCAD application.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Use the "WindowState" variable to determine the window state of AutoCAD
    (setq CurrentState (cond 
                           ((= (vla-get-WindowState acadObj) acMin) "Minimized")
                           ((= (vla-get-WindowState acadObj) acMax) "Maximized")
                           ((= (vla-get-WindowState acadObj) acNorm) "Normal Size")
                       ))
    ;; Display window state
    (alert (strcat "AutoCAD is now: " CurrentState))
)