I'm really sorry Rashad, and I truly appreciate that you're really trying hard to help and all the time you've put into it, but your last updated code still fails. Here's what happens if I give the focus to a maximized Notepad window (which must not be included in the screenshot):
Like I said in the first post, I just want the foreground window, no matter what size it is, to not be included. So line 21 shouldn't be looking for a specific hard-coded window title anyway, and should be testing for GetForegroundWindow_() instead.