Hello, could you help me with any examples how to detect any displayed dialogs in browser?

I have such function:

Function xc_browser_get_count
On Error Resume Next

Set osa = CreateObject ("Shell.Application")

If isObject(osa) Then
ie_count = 0

Set ie_windows = osa.Windows

For Each ie_window In ie_windows

windows_type = ""
windows_type = TypeName(ie_window.document)

If UCase(windows_type) = "HTMLDOCUMENT" Then
ie_count = ie_count + 1
End If

Set ie_windows = Nothing
End If

Set osa = Nothing

xc_browser_get_count = ie_count
End Function

that return the number of opened browser. If the any methods, to detect, is the window (dialog) belong to browser?