Option Compare Database
Declare Function apiGetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
Declare Function apiGetParent Lib "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
Declare Function apiIsIconic Lib "user32" Alias "IsIconic" (ByVal hwnd As Long) As Long
Declare Function apiIsZoomed Lib "user32" Alias "IsZoomed" (ByVal hwnd As Long) As Long
Private Function IsAccessMaximized(rfrm As Form)
If apiIsZoomed(rfrm.hwnd) = 0 Then 'GetAccesshWnd()
IsAccessMaximized = False
Else
IsAccessMaximized = True
End If
End Function
Private Function IsAccessMinimized(rfrm As Form)
If apiIsIconic(rfrm.hwnd) = 0 Then
IsAccessMinimized = False
Else
IsAccessMinimized = True
End If
End Function
Private Function IsAccessRestored(rfrm As Form)
If IsAccessMaximized(rfrm) = False And _
IsAccessMinimized(rfrm) = False Then
IsAccessRestored = True
Else
IsAccessRestored = False
End If
End Function
Public Function GetWindowState(rfrm As Form) As Integer
If IsAccessMaximized(rfrm) = True Then
GetWindowState = 2
Exit Function
End If
If IsAccessMinimized(rfrm) = True Then
GetWindowState = 0
Exit Function
Else
GetWindowState = 1
Exit Function
End If