Project1

标题: RM如何调用DLL [打印本页]

作者: 熊猫    时间: 2008-11-16 01:03
标题: RM如何调用DLL
VB里这样调用:
Private Declare Function mathadd Lib "DLL地址" (ByVal a As Long, ByVal b As Long) As Long

在RM里如何调用? [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 莳衍灵儿    时间: 2008-11-16 01:31
module RM_Tray

Add_Tray    = Win32API.new("RMTray","_add_tray","l","v")
Modify_Tray = Win32API.new("RMTray","_modify_tray","v","v")
Remove_Tray = Win32API.new("RMTray","_remove_tray","v","v")

buf = 0.chr * 256
gpps = Win32API.new("kernel32","GetPrivateProfileString","pppplp","l")
gpps.call("Game","Title","",buf,256,"./Game.ini")
buf.delete!("\0")
HWND = Win32API.new("user32","FindWindow","pp","i").call("RGSS Player",buf)

def self.add(hwnd = HWND)
   Add_Tray.call(hwnd)
end

def self.modify
   Modify_Tray.call
end

def self.remove
   Remove_Tray.call
end

end
   
RM_Tray.add


^-^~我承认我是复制的~因为电脑上刚好有存~{/hx}
作者: IamI    时间: 2008-11-16 01:34
做懒人,是可以的吗= =
http://rpg.blue/viewthread.php?tid=95679
不需要再说明了吧=v=要的话请直接参考LS,引用文件夹下的DLL请加目录名 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 熊猫    时间: 2008-11-16 05:45
我又不是没看。。。实在看不明白第三个和第四个参数

试了多次都出现错误




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1