def wait_for_close(options={})
      seconds = options[:timeout] || 5
      timeout(seconds) do
        begin
          yield if block_given?
          sleep 0.05
        end until 0 == IsWindow(handle)
      end
    end
def wait_for_close(options={})
      seconds = options[:timeout] || 5
      timeout(seconds) do
        begin
          yield if block_given?
          sleep 0.05
        end until 0 == IsWindow(handle)
      end
    end
Wait for the window to close

 @param [Hash] options
 @option options [Boolean] :timeout (5) timeout in seconds