3
使用win32api
Ruby win32api和win32ole有什么区别?
require "Win32API"
message = "This is a sample Windows message box generated using Win32API"
title = "Win32API from Ruby"
api = Win32API.new('user32', 'MessageBox',['L', 'P', 'P', 'L'],'I')
api.call(0,message,title,0)
首先一个使用win32ole
require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
ie.visible = true
ie.gohome
某些代码一块红宝石代码打开的Internet Explorer,第二个显示一个消息框。 简单地说,两者似乎都可以访问操作系统并使其执行任务。 win32ole是win32api的一个子集,还是相反?两者有什么区别?