Win32API Sample: MessageBox
require 'Win32API'
=begin
Message Box:
Coded by CFC
CFC
2007/2/16
=end
class Msgbox
def initialize(lpText="", lpCaption="", wType = 0)
Win32API.new('user32', 'MessageBox', %w(p p p i), 'i').call(0,lpText,lpCaption,wType)
end
end
def Msgbox(lpText="", lpCaption="", wType = 0)
Win32API.new('user32', 'MessageBox', %w(p p p i), 'i').call(0,lpText,lpCaption,wType)
end
採用MIT授權條款
Usage:
Msgbox.new("Hi", "Hello, world")
Msgbox.new("XD", "Hello!", 1)
Msgbox("Hi", "Hello!")
3 則留言:
該怎麼顯示中文??
我用會出現亂碼...
張貼留言