Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Function Ismdiform(hwnd As Long) As Boolean
Dim mdihwnd As Long
mdihwnd = GetWindowLong(hwnd, -12)
If mdihwnd = 0 Then
Ismdiform = False
Exit Function
Else
Ismdiform = True
Exit Function
End If
End Function
Declare Function GetParent Lib "user32" Alias "GetParent" (ByVal hwnd As Long) As Long
Function isMdiForm(hwnd as long) as Boolean
dim mdiformhwnd as long
mdiformhwnd=GetParent(hwnd)
if mdiformhwnd=0 then
IsMdiform=False 'No MDI
Exit Function
else
isMdiForm=True
exit function
end if
end function