When window capture is not capturing a window, don't try to find the window every frame. Instead, just check once per frame. The process of finding a window has a lot of checks and requires a surprising amount of processing.