From: King Maker on

I try Many thing but not find the best solution to maximize the window.
i run the script every time window open in the normal size.

........................ Help me ..........................

require 'watir'
include Watir

ie=Watir::IE.start("http://www.google.co.in")

#~ie.maximize

# Minimize the window
def maximize
set_window_state :SW_MAXIMIZE
end
def set_window_state(state)
autoit.WinSetState title, '', autoit.send(state)
end
def autoit
Watir::autoit
end

def self.autoit
unless @@autoit
begin
@@autoit = WIN32OLE.new('AutoItX3.Control')
rescue WIN32OLERuntimeError
_register('AutoItX3.dll')
@@autoit = WIN32OLE.new('AutoItX3.Control')
end
end
@@autoit
end

Version:
gem 0.9.4
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
--
Posted via http://www.ruby-forum.com/.