Function prodCheckOffenesFenster(hActualWindowHandle As Long, sNameParentWindowas As String, sNameChildWindow As String) As Boolean Dim sName As String Dim hWndM As Long Dim hWndS As Long Dim sWinName As String Dim bBrowser As Boolean hWndM = GetWindow(hActualWindowHandle, GW_HWNDFIRST) prodCheckOffenesFenster = False If hWndM > 0 Then Do sWinName = String(100, Chr$(0)) GetWindowText hWndM, sWinName, 100 sWinName = Left(sWinName, InStr(1, sWinName, Chr$(0)) - 1) If Left(sWinName, Len(sNameChildWindow)) = sNameChildWindow Then prodCheckOffenesFenster = True hWndS = GetParent(hWndM) sWinName = String(100, Chr$(0)) GetWindowText hWndS, sWinName, 100 If Left(sWinName, Len(sNameParentWindowas)) = sNameParentWindowas Then antwort = MessageBox(hWndS, "Das Fenster " & sNameChildWindow & " ist noch geöffnet." & vbNewLine & _ "Eine Weiterverarbeitung des Programms ist so nicht möglich!" & vbNewLine & vbNewLine & _ "Soll das Fenster geschlossen werden?", "Warnung", MB_YESNO + MB_ICONEXCLAMATION) If antwort = vbYes Then SendMessage hWndM, &H10, 0, 0 prodCheckOffenesFenster = False Else prodCheckOffenesFenster = True End If Exit Do End If End If hWndM = GetWindow(hWndM, GW_HWNDNEXT) Loop Until hWndM = 0 End If End Function