On 5/8/05, Peter C. Verhage <> wrote:
> Hi,
>
> I want to use Ruby/DL to call the Win32 user32.dll SendInput method
> (http://tinyurl.com/jrxm). Unfortunately this method takes some complex
> arguments; several nested structs, including a union and a pointer to an
> array of a certain struct etc. How can I use Ruby/DL to call this method?
>
> Regards,
>
> Peter
>
>
Did you try the Win32API module?
You code would look something like this:
require 'Win32API'
sendInput = Win32API.new("user32", "SendInput", ['I', 'P', 'I'], 'I')
# you'll have to pack the INPUT string in the appropiate manner
input = some_array.pack(some_fmt)
sendInput.call(num_inputs, input, sizeofINPUT)