Forum: Ruby win32-api 1.0.0

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2007-09-17 13:24
(Received via mailing list)
Hi all,

The Win32Utils Team is happy to announce the first release of win32-api.

= What is it?
This is a replacement for the Win32API library that currently ships with
the Ruby standard library.

= Quick Synopsis
require 'win32/api'
include Win32

# Typical stuff
buf = 0.chr * 260
len = [@buf.length].pack('L')

GetUserName ='GetUserName', 'PP', 'I', 'advapi32'), len)

puts buf.strip

# Callback example
EnumWindows     ='EnumWindows', 'KP', 'L', 'user32')
GetWindowText   ='GetWindowText', 'LPI', 'I', 'user32')
EnumWindowsProc ='LP', 'I'){ |handle, param|
    buf = "\0" * 200, buf, 200);
    puts buf.strip
    buf.index(param).nil? ? true : false
}, 'UEDIT32')

= What are the advantages over Win32API?
* Added callback support!
* Uses the Ruby 1.8.x allocation framework internally
* Now properly under the Win32 namespace
* Argument order change to the constructor that allows sensible defaults
* Better internal documentation
* It's actually maintained

= How do I get it?
There are two gems. Use the "mswin32" gem to install a prebuilt binary
(built via VC++ 6). Use the "plain" gem to build from source if you have
a compiler installed.

Or, you can download the source directly from the RubyForge project page


The Win32Utils Team
This topic is locked and can not be replied to.