赞 | 23 |
VIP | 22 |
好人卡 | 18 |
积分 | 608 |
经验 | 44466 |
最后登录 | 2024-11-9 |
在线时间 | 1934 小时 |
Lv6.析梦学徒 Fuzzy Ginkgo Taciturn Knight
- 梦石
- 0
- 星屑
- 60814
- 在线时间
- 1934 小时
- 注册时间
- 2010-6-26
- 帖子
- 1605
|
本帖最后由 orzfly 于 2013-2-2 20:49 编辑
$RGSSGameMain = Win32API.new("RGSS300", "RGSSGameMain", "IPP", "V") $GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l') $RGSSGameMain.call($GetActiveWindow.call,"C\000:\000\\\000T\000e\000m\000p\000\\\000R\000M\000V\000A\000\\\000S\000c\000r\000i\000p\000t\000s\000.\000r\000v\000d\000a\000t\000a\0002\000\000\000","")
$RGSSGameMain = Win32API.new("RGSS300", "RGSSGameMain", "IPP", "V")
$GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
$RGSSGameMain.call($GetActiveWindow.call,"C\000:\000\\\000T\000e\000m\000p\000\\\000R\000M\000V\000A\000\\\000S\000c\000r\000i\000p\000t\000s\000.\000r\000v\000d\000a\000t\000a\0002\000\000\000","")
#============================================================================== # ■ String #------------------------------------------------------------------------------ # 为字符串追加编码转换的机能。 #============================================================================== # 参考: #http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072(v=vs.85).aspx #http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130(v=vs.85).aspx #http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx #============================================================================== class String MultiByteToWideChar = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i') WideCharToMultiByte = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i') def to_uni len = MultiByteToWideChar.call 65001, 0, self, -1, nil, 0 buf = "\0" * (len * 2 + 2) MultiByteToWideChar.call 65001, 0, self, -1, buf, buf.size / 2 buf end def from_uni len = WideCharToMultiByte.call 65001, 0, (self.respond_to?(:force_encoding) ? self.force_encoding("ASCII-8BIT") : self) + "\000\000", -1, nil, 0, nil, nil ret = "\0" * len WideCharToMultiByte.call 65001, 0, self, -1, ret, ret.size, nil, nil self.respond_to?(:force_encoding) ? ret.force_encoding("ASCII-8BIT").delete("\000") : ret.delete("\000") end end $RGSSGameMain = Win32API.new("RGSS300", "RGSSGameMain", "IPP", "V") $GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l') $RGSSGameMain.call($GetActiveWindow.call,"C:\\Temp\\RMVA\\Scripts.rvdata2".to_uni,"")
#==============================================================================
# ■ String
#------------------------------------------------------------------------------
# 为字符串追加编码转换的机能。
#==============================================================================
# 参考:
#http://msdn.microsoft.com/en-us/library/windows/desktop/dd319072(v=vs.85).aspx
#http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130(v=vs.85).aspx
#http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
#==============================================================================
class String
MultiByteToWideChar = Win32API.new('kernel32', 'MultiByteToWideChar', 'ilpipi', 'i')
WideCharToMultiByte = Win32API.new('kernel32', 'WideCharToMultiByte', 'ilpipipp', 'i')
def to_uni
len = MultiByteToWideChar.call 65001, 0, self, -1, nil, 0
buf = "\0" * (len * 2 + 2)
MultiByteToWideChar.call 65001, 0, self, -1, buf, buf.size / 2
buf
end
def from_uni
len = WideCharToMultiByte.call 65001, 0, (self.respond_to?(:force_encoding) ? self.force_encoding("ASCII-8BIT") : self) + "\000\000", -1, nil, 0, nil, nil
ret = "\0" * len
WideCharToMultiByte.call 65001, 0, self, -1, ret, ret.size, nil, nil
self.respond_to?(:force_encoding) ?
ret.force_encoding("ASCII-8BIT").delete("\000") :
ret.delete("\000")
end
end
$RGSSGameMain = Win32API.new("RGSS300", "RGSSGameMain", "IPP", "V")
$GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
$RGSSGameMain.call($GetActiveWindow.call,"C:\\Temp\\RMVA\\Scripts.rvdata2".to_uni,"")
|
评分
-
查看全部评分
|