Help with Win32API needed

So, for my RGSS Addon, I decided they I should use the win32api to set pixels and that sort of stuff. So, I got the handle of device context, and I tried to set several pixels in the window, but the function keeps returning -1 (failure). There's probably something that I'm missing, but could someone help me figure this out.

My code:
  1.  
  2. def win32test
  3.     @find_window = Win32API.new("user32", "FindWindow", "LL", "L")
  4.     @set_pixel = Win32API.new("gdi32", "SetPixel", "PIIP", "I")
  5.     window = @find_window.call("RGSS Player", "Test")
  6.     color = 0x00FF0000
  7.     result = @set_pixel.call(window, 0, 0, color)
  8.     print result
  9. end
  10.  
Expand to see the code.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=76590