Current Path : /usr/local/share/examples/ruby18/dl/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/share/examples/ruby18/dl/msgbox.rb |
# This script works on Windows. require 'dl' User32 = DL.dlopen("user32") Kernel32 = DL.dlopen("kernel32") MB_OK = 0 MB_OKCANCEL = 1 message_box = User32['MessageBoxA', 'ILSSI'] r,rs = message_box.call(0, 'ok?', 'error', MB_OKCANCEL) case r when 1 print("OK!\n") when 2 print("Cancel!\n") end