| 赞 | 1 |
| VIP | |
| 好人卡 | |
| 积分 | 4 |
| 经验 | |
| 最后登录 | 2015-5-11 |
| 在线时间 | 1291 小时 |
- 梦石
- 0
- 星屑
- 407
- 在线时间
- 1291 小时
- 注册时间
- 2013-1-12
- 回帖
- 3349

|
发表于 2013-6-27 11:07:46
|
显示全部楼层
樓上的我測試了 可行
具体腳本如下- dir = Win32API.new('kernel32','GetSystemDirectory','p,l','l')
- dir_str = " " * 256
- dir.call(dir_str,255)
- dir_str = dir_str.split('system')[0]
- font_name = "DFGirl.ttf"
- font_chn_name = "华康少女字体"
- if FileTest.exist?(font_name)
- copy = Win32API.new('kernel32',"CopyFileA",'p,p,l','')
- copy.call(font_name, "#{dir_str}Fonts/#{font_name}",0)
- font = Win32API.new('gdi32','AddFontResourceA','p','l')
- sendmsg = Win32API.new('user32','SendMessageA','l,l,l,l','l')
- unless Font.exist?("DFGirl") or Font.exist?(font_chn_name)
- font.call(font_name)
- sendmsg.call(65535,29,0,0)
- end
- end
复制代码 |
|