From: David Mullet Date: 2008-12-27T08:35:52+09:00 Subject: Re: Win32API- GetForegroundWindows() Diego Guti wrote: > Hi! > > I'm playing with the API of Windows, but I haven't found much > information about that (almost all is for VB -.- ) > > So I'd like to know where can I search for it. > Im trying to get de windows where the user is working, i have: > > a = Win32API.new('user32', 'GetForegroundWindow', [], 'P') > a.Call() > > But it doesnt work... The GetForegroundWindow function doesnt need > params and it returns a handle of the windows, so i think it should > run... > > Thanks. > > P.S.: Sorry, English is not my first language :) Try changing your last parameter from 'P' to 'N': a = Win32API.new('user32', 'GetForegroundWindow', [], 'N') window = a.Call() David -- Posted via http://www.ruby-forum.com/.