Created
December 14, 2011 17:34
-
-
Save pioz/1477585 to your computer and use it in GitHub Desktop.
Inputbox in Ruby using win32ole
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'win32ole' | |
def inputbox(message, title = '') | |
sc = WIN32OLE.new("ScriptControl") | |
sc.language = "VBScript" | |
sc.eval("Inputbox(\"#{message}\", \"#{title}\")") | |
end | |
def popup(message) | |
wsh = WIN32OLE.new('WScript.Shell') | |
wsh.popup(message, 0, __FILE__) | |
end | |
res = inputbox('Your input please.', 'Inputbox example') | |
popup("Your input is #{res}!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment