JRuby-FFIを使ってWindowsのMessageBoxを呼び出す

JRubyには、FFIライブラリがはじめから同封されています。
FFIは、Ruby/DLと類似しています。
以下にコードを記載します。

require 'ffi'

module Win32
  extend FFI::Library
  ffi_lib 'User32'
  ffi_convention :stdcall
  attach_function :message_box_a, :MessageBoxA, [:pointer,:string,:string,:int], :int
end

p Win32.message_box_a(nil, "Msssage\nOK?", "title", 0)