IsFormModal – Determines whether a form is modal

IsFormModal – Determines whether a form is modal

Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _    (ByVal hWnd As Long, ByVal nIndex As Long) As LongConst GWL_STYLE = (-16)Const WS_DISABLED = &H8000000' Return True if the form is modal'' Note: if an application has only one visible'       form, this function considers it as modalFunction IsFormModal(frm As Form) As Boolean    Dim f As Form        For Each f In Forms        If Not (f Is frm) Then            If (GetWindowLong(f.hWnd, GWL_STYLE) And WS_DISABLED) = 0 Then                ' there is another enabled form, so this form                ' can't be modal                Exit Function            End If        End If    Next    ' all other forms are disabled, therefore this form is modal    IsFormModal = True    End Function

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular