Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

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:
Code:
 

def win32test

    @find_window = Win32API.new("user32", "FindWindow", "LL", "L")

    @set_pixel = Win32API.new("gdi32", "SetPixel", "PIIP", "I")

    window = @find_window.call("RGSS Player", "Test")

    color = 0x00FF0000

    result = @set_pixel.call(window, 0, 0, color)

    print result

end

 
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top