You got to say this:

If $objWindows.Item($varCount).Hwnd = $varHwnd