我是 Ruby 新手,我一直试图让这段代码调用 MessageBox,但不能。我知道我错过了一些东西,但我不知道它是什么。对此的任何帮助将不胜感激!
这是到目前为止的代码:
require 'Win32API'
LoadLibrary = Win32API.new('kernel32','LoadLibrary','P','L')
GetProcAddress = Win32API.new('kernel32','GetProcAddress','LP','L')
Load = LoadLibrary.call('user32.dll')
Proc = GetProcAddress.call(Load,'MessageBox')
Proc.call(0,"Hello World!","MessageBox in Ruby",0)
我知道一切都很好,除了我的“Proc.call”。我错过了什么?