Not sure what your error was.  The code I posted works on WIN2K, It
did not work on XP

Please try this sample
# Reference: 
http://www.rubytips.org/2008/05/13/accessing-windows-api-from-ruby-using-win32api-library/

require 'Win32API'

message = "This is a sample Windows message box generated using
Win32API"
title = "Win32API from Ruby"

api = Win32API.new('user32','MessageBox',['L', 'P', 'P', 'L'],'I')
api.call(0,message,title,0)








On Aug 30, 5:33 pm, byung <[email protected]> wrote:
> I put below code..
>
> def method_messagebox(txt,title,buttons)
>   puts ' * method_messagebox'
>   user32 = DL.dlopen('user32')
>   msgbox = user32[ 'MessageBoxA', 'ILLSI' ]
>   r, rs = msgbox.call(0,txt,title,0)
> return r
> end
> response = method_messagebox('Script is waiting for user to click
> OK','Manual Interrupt', 0)
>
> but I get below error..
>
> in 'call': can't convert String into Integer <TypeError>  from
> xxx.code.rb:22: in 'method_messagebox'
>
> On Aug 30, 2:03 pm, Super Kevy <[email protected]> wrote:
>
>
>
> > in the call statement the
> > First value is an integer it should be Zero
> > Second Value is a string
> > Third Value is a string
> > Fourth value is an integer in the sample its a Zero
>
> > check your inputs
>
> > On Aug 30, 3:51 pm, byung <[email protected]> wrote:
>
> > > i get below error..
>
> > > in 'call': can't convert String into Integer <TypeError>  from
> > > xxx.code.rb:22: in 'method_messagebox'
>
> > > On Aug 30, 1:31 pm, Rahul Sharma <[email protected]> wrote:
>
> > > > Would like to know why you would want to wait between steps in your 
> > > > automated tests as when they will run, who will click on these links 
> > > > when they run on a daily basis.
>
> > > > I haven't tried this myself but give it a try to see what it does:
>
> > > > wait_until{browser.button(:id => 'button').click}
>
> > > > On 30 Aug 2011, at 21:25, Super Kevy wrote:
>
> > > > > Not sure why you want manual stops but consider this:
>
> > > > > def method_messagebox(txt,title,buttons)
>
> > > > > On Aug 30, 11:54 am, byung <[email protected]> wrote:
> > > > >> Is there a way to make Watir code to wait for user's click event??
>
> > > > >> I would like to run the Watir code.. and while it is running, wait
> > > > >> till the user click a link on the web page..
>
> > > > >> If the user click a link on the page, and then the code go to next
> > > > >> step...
>
> > > > >> How would it be possible to do this??
>
> > > > >> Wait, User Click the link, go to next step in the Watir code.. Wait,
> > > > >> User Click the link, and then go to next step..
>
> > > > >> any help will be deeply appreciated.
>
> > > > > --
> > > > > Before posting, please readhttp://watir.com/support. In short: search 
> > > > > before you ask, be nice.
>
> > > > > [email protected]
> > > > >http://groups.google.com/group/watir-general
> > > > > [email protected]
>
> > > > Regards,
> > > > Rahul Sharma- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to