boy11-2 发表于 2011-02-09 16:31

Ruby 打开 Windows 对话框并获取返回值

require 'Win32API'

title = "My Application"
text = "Hello, world!"

dialog = Win32API.new('user32', 'MessageBox', 'LPPL', 'I')
result = dialog.call(0, text, title, 1)

case result
when 1:
    puts "Clicked OK"
when 2:
    puts "Clicked Cancel"
else
    puts "Clicked something else!"
end

ziyiu123 发表于 2011-02-22 19:47

ruby操纵win对话框,感觉是调autoit的东西,
页: [1]
查看完整版本: Ruby 打开 Windows 对话框并获取返回值