def Win32API.GetPrivateProfileString(section, key)
val = "\0"*256
gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
gps.call(section, key, "", val, 256, GAME_INI_FILE)
val.delete!("\0")
return val
end
def Win32API.FindWindow(class_name, title)
fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
hWnd = fw.call(class_name, title)
return hWnd
end
HWND_TOP = 0
HWND_TOPMOST = -1
SWP_NOMOVE = 2
def Win32API.SetWindowPos(hWnd, w, h)
swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
ok = swp.call(hWnd, HWND_TOP, 0, 0, w, h, SWP_NOMOVE)
return ok
end
end
#以下是分辨率变更
title = Win32API.GetPrivateProfileString("Game", "Title")
hWnd = Win32API.FindWindow("RGSS Player", title)
#使用时X轴加6,Y轴加25,否则画面会变形
ok = Win32API.SetWindowPos(hWnd, 400, 600)
if(ok == 0)
p "失败"
end