Yoann Guillot
3/12/2006 9:12:00 AM
> This is probably documented somewhere, but I thought ruby win32
> programmers on the list may find this of use.
>
> require 'Win32API'
>
> def message_box
<bunch of constants>
> mb = Win32API.new("user32", "MessageBox", ['i','p','p','i'], 'i')
> mb.call(0, 'message', "title", 0)
> end
>
> x = message_box
>
I personnaly prefer using DL::Importable :
require 'dl/import'
module User32
extend DL::Importable
dlload 'user32'
extern 'long MessageBox(long, char*, char*, long)'
end
User32.messageBox(0, 'i love dl', 'hello', 0)
--
Yoann Guillot