I take it you mean Ruby then, since RGSS is not a computer language. That may be a pretty big obstacle to you right there.
Look into the Win32API class of Ruby, and figure out what pointers you need, how to pack them, and what methods to call by examining the DLL and its documentation.
As for GameMaker, I have never used it and have no idea how to do it with GML, so good luck on that.