WinAPI Changes for the RGSS3 Player?

I have been playing around with the WinAPI and RGSS3 for a while and I stumbled upon a script I wanted to make, though, there's a small problem on it. Using the 'RGSS Player' gives me an exact 544 x 416 snapshot, however, changing it to 'RGSS3 Player' somehow diverts the snapshot into a different x and y, capturing only a portion of the screen.

Here's what I am talking about:

def self.screenshot_game_sc prtsc_screenshot = Win32API.new('screenshot.dll', 'Screenshot', %w(l l l l p l l), '') window = Win32API.new('user32', 'FindWindowA', %w(p p), 'l') ini = (Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l') ace_game_name = "\0" * 256 ini.call('Game', 'Title', '', ace_game_name, 255, '.\Game.ini') ace_game_name.delete!('\0') win = window.call('RGSS Player', ace_game_name) dir = Dir.new("Screenshots/") count = 0 dir.entries.each {|i| count += 1} ace_file_name = "Screenshots/shot#{count}.png" prtsc_screenshot.call(0, 0, 544, 416, ace_file_name, win, 2) endHere's how this works, using a dll, this should work exactly as I want it to be, but whenever I do use RGSS3 player, it doesn't seem to work that much as I wanted. Is there a difference of how I should use the Win32API for the RGSS3?
You are misunderstanding how the FindWindow function works. The first argument is the name of the window's class which is only visible basically if you can find the window through other means, use GetWindowInfo, and unpack that struct to get to the name the window was registered under. This happens to be 'RGSS Player', even in RGSS3. This argument is actually optional (nil if you don't want to use it), the main way the window is found is with the GetPrivateProfileString parsing the ini file for the game name and finding a window with that exact title. What is happening when you use 'RGSS3 Player' is that it is not finding the proper window since you are restricting the search to windows with the class name "RGSS3 Player", and from there the screenshot function is probably capturing based off either some default coordinates or just your desktop (or some special case that happens when hWnd == 0).
Hmmm, I see. I'll try your method and learn more how it works. Thanks for making clear to me why it only captures a portion of my game screen. I'll just have to fix that later as well (just in case).

Original thread: https://forums.rpgmakerweb.com/threads/winapi-changes-for-the-rgss3-player.26211/