pp8609 发表于 2010-12-1 10:55:58

怎么调整主窗口分辨率,如默认的640*480调整成800*600

如题

secondsen 发表于 2010-12-1 23:04:47

if $myfirst == nil
   
   $myfirst = 'myGod'   
   宽度=800
   高度=600
   游戏ini名=".\\\\Game.ini"
   val = "\\0"*256
   gps = Win32API.new('kernel32', 'GetPrivateProfileString','pppplp', 'l')
   gps.call("Game", "Title", "", val, 256, 游戏ini名)
   val.delete!("\\0")
   title = val
   fw = Win32API.new('user32', 'FindWindow', 'pp', 'i')
   hWnd = fw.call("RGSS Player", title)
   swp = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')

   pointwds = .pack('llll')
   pointcet = .pack('ll')

   wdsrect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l')
   client_screen = Win32API.new("user32", "ClientToScreen", 'ip', 'i')

   wdsrect.call(hWnd,pointwds)
   client_screen.call(hWnd, pointcet)

   wds = pointwds.unpack('llll')
   cet = pointcet.unpack('ll')

   addw =wds - wds - 640
   addh =wds - wds - 480

   x = wds - (宽度 - 640) / 2
   y = wds - (高度 - 480) / 2

   swp.call(hWnd, 0, x, y, 宽度 + addw, 高度 + addh, 0x20)
   
end
页: [1]
查看完整版本: 怎么调整主窗口分辨率,如默认的640*480调整成800*600