From: Tim Kalinowski Date: 2012-03-18T09:03:09+09:00 Subject: Help with using DL and user32.dll to get the active window. I'm still new to ruby and am having trouble working out how to access windows API with DL So far my code looks like this: require "dl" user32 = DL.dlopen('user32') actwindow = DL::CFunc.new(user32['GetActiveWindow'],type=DL::TYPE_VOID, 'GetActiveWindow') actwindow.call([]) I realise .call my argument is an empty array, I'm not sure what arguments I should be sending when the 'GetActiveWindow' method is TYPE_VOID Any hits in the right direction would be highly appreciated! GetActiveWindow -> http://msdn.microsoft.com/en-us/library/windows/desktop/ms646292%28v=vs.85%29.aspx