Private Const GWL_STYLE As Long = -16
Private Const WS_DISABLED As Long = &H8000000
Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Property Get IsModal(ByRef voForm As Form) As Boolean
Dim oForm As Form
Dim bModalWindowExist As Boolean
For Each oForm In Forms
If (GetWindowLong(oForm.hwnd, GWL_STYLE) And WS_DISABLED) = WS_DISABLED Then
bModalWindowExist = True
ElseIf oForm Is voForm Then
IsModal = True
Exit For
End If
Next oForm
IsModal = IsModal And bModalWindowExist
End Property