From: Diego Guti Date: 2008-12-28T03:08:35+09:00 Subject: Re: Win32API- GetForegroundWindows() > You can use the GetWindowText API call. Pass it (1) your window handle, > (2) a string buffer into which the text is to be copied, and (3) the > maximum number of characters to copy to the buffer: > > require 'Win32API' > > getForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', [], > 'L') > getWindowText = Win32API.new('user32', 'GetWindowText', ['L', 'P', 'I'], > 'I') > > window_handle = getForegroundWindow.Call() > title_buffer = ' ' * 256 > getWindowText.Call(window_handle, title_buffer, 256) > puts(title_buffer) > > David Ok. Thank you very much !! Now It's perfect. Regards -- Posted via http://www.ruby-forum.com/.