dann funktioniert es genau so, wie es soll
Ja, hatte ich in Post #3 ja dann bemerkt.
Ein Problem ist nur noch die Kontrolle, welches tatsächlich das Fenster ist, welches als aktiv betrachtet wird. GetForegroundWindow() liefert oft auch "0" als Ergebnis.