test CheckCurrentWindow function