设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1437|回复: 1
打印 上一主题 下一主题

[已经解决] 求一个去边框的脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-11
帖子
49
跳转到指定楼层
1
发表于 2014-2-24 18:37:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
如题,想要一个去边框的脚本,效果和这个一样,不过这是va的--

这是va去边框的代码,新人求助啊。
RUBY 代码复制
  1. # (WinUser.h 中的一些宏)
  2. # GWL_STYLE        = -16
  3. # WS_CAPTION       = 0x00C00000L
  4. # SM_CXSCREEN      = 0
  5. # SM_CYSCREEN      = 1
  6. # SWP_FRAMECHANGED = 0x0020
  7.  
  8. # 防止 F12 后再次执行
  9. if $START_NOCAPTION == nil
  10.   $START_NOCAPTION = 1
  11.   getPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", ['P', 'P', 'P', 'P', 'L', 'P'], 'L')
  12.   findWindow = Win32API.new("user32", "FindWindow", ['P', 'P'], 'L')
  13.   getWindowLong = Win32API.new("user32", "GetWindowLong", ['L', 'I'], 'L')
  14.   setWindowLong = Win32API.new("user32", "SetWindowLong", ['L', 'I', 'L'], 'L')
  15.   getSystemMetrics = Win32API.new("user32", "GetSystemMetrics", ['I'], 'I')
  16.   setWindowPos = Win32API.new("user32", "SetWindowPos",['L', 'L', 'I', 'I', 'I', 'I', 'I'], 'L')
  17.  
  18.   # 分配字符串缓冲区
  19.   title = " " * 128
  20.   # 通过读取 Game.ini 获取窗口标题
  21.   getPrivateProfileString.call("Game", "Title", "", title, 128, "./Game.ini")
  22.   # 通过窗口类名和标题获取窗口句柄
  23.   hWnd = findWindow.call('RGSS Player', title)
  24.  
  25.   # 获取窗口样式
  26.   style = getWindowLong.call(hWnd, -16)
  27.   # 去掉 WS_CAPTION 样式
  28.   style &= ~0x00C00000
  29.   # 应用新样式
  30.   setWindowLong.call(hWnd, -16, style)
  31.   # 获取屏幕尺寸
  32.   scr_width = getSystemMetrics.call(0)
  33.   scr_height = getSystemMetrics.call(1)
  34.   # 更新窗口框架并居中
  35.   setWindowPos.call(hWnd, 0, (scr_width - 544) / 2, (scr_height - 416) / 2, 544, 416, 0x0020)
  36. end

Lv1.梦旅人

梦石
0
星屑
50
在线时间
230 小时
注册时间
2014-2-16
帖子
175
2
发表于 2014-2-24 18:45:01 | 只看该作者
  1. # (WinUser.h 中的一些宏)
  2. # GWL_STYLE        = -16
  3. # WS_CAPTION       = 0x00C00000L
  4. # SM_CXSCREEN      = 0
  5. # SM_CYSCREEN      = 1
  6. # SWP_FRAMECHANGED = 0x0020

  7. # 防止 F12 后再次执行
  8. if $START_NOCAPTION == nil
  9.   $START_NOCAPTION = 1
  10.   getPrivateProfileString = Win32API.new("kernel32", "GetPrivateProfileString", ['P', 'P', 'P', 'P', 'L', 'P'], 'L')
  11.   findWindow = Win32API.new("user32", "FindWindow", ['P', 'P'], 'L')
  12.   getWindowLong = Win32API.new("user32", "GetWindowLong", ['L', 'I'], 'L')
  13.   setWindowLong = Win32API.new("user32", "SetWindowLong", ['L', 'I', 'L'], 'L')
  14.   getSystemMetrics = Win32API.new("user32", "GetSystemMetrics", ['I'], 'I')
  15.   setWindowPos = Win32API.new("user32", "SetWindowPos",['L', 'L', 'I', 'I', 'I', 'I', 'I'], 'L')
  16.   
  17.   # 分配字符串缓冲区
  18.   title = " " * 128
  19.   # 通过读取 Game.ini 获取窗口标题
  20.   getPrivateProfileString.call("Game", "Title", "", title, 128, "./Game.ini")
  21.   # 通过窗口类名和标题获取窗口句柄
  22.   hWnd = findWindow.call('RGSS Player', title)
  23.   
  24.   # 获取窗口样式
  25.   style = getWindowLong.call(hWnd, -16)
  26.   # 去掉 WS_CAPTION 样式
  27.   style &= ~0x00C00000
  28.   # 应用新样式
  29.   setWindowLong.call(hWnd, -16, style)
  30.   # 获取屏幕尺寸
  31.   scr_width = getSystemMetrics.call(0)
  32.   scr_height = getSystemMetrics.call(1)
  33.    # 更新窗口框架并居中
  34.   setWindowPos.call(hWnd, 0, (scr_width - 640) / 2, (scr_height - 480) / 2, 640, 480, 0x0020)
  35. end
复制代码

点评

谢了  发表于 2014-2-24 18:49

评分

参与人数 1梦石 +1 收起 理由
myownroc + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-30 20:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表