Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

 
Reply to this topicStart new topic
> Help with Win32API needed
Thallion
post May 20 2012, 04:12 AM
Post #1


Level 5
Group Icon

Group: Member
Posts: 68
Type: Scripter
RM Skill: Skilled
Rev Points: 10




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
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 12:03 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker