require 'Win32API' Dir[File.dirname(__FILE__) + "/messagebox" << '/*.rb'].each do |file| require file end class MessageBox def initialize(title, message, style = 0) @title = title @message = message @style = style end def self.show(title, message, style = 0) Win32API.new( "user32", "MessageBox", %w(p p p i), 'i' ).call(nil, message, title, style) end def show(message = nil, title = nil) MessageBox.show(title || @title, message || @message, @style) end end