Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Help with Win32API

The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: ThallionDarkshine on May 20, 2012, 12:50:19 PM

Title: Help with Win32API
Post by: ThallionDarkshine on May 20, 2012, 12:50:19 PM
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:
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