From: Shusaku Date: 2002-10-31T16:49:10+09:00 Subject: Re: Close Internet Explorer On Wed, 30 Oct 2002 22:07:21 +0900 "Chris Morris" wrote: > I'm guessing your best bet will be to dive into API calls (see Win32API). > There are routines to enumerate existing windows and get handles to them, > you should be able to shut them down that way. As far as I know, Win32API.so can not support API that uses a callback procedure such as EnumWindows(). Ruby/DL will be the better one for his problem. Ruby/DL -- http://www.ruby-lang.org/en/raa-list.rhtml?id=629 require 'dl' User32 = DL.dlopen("user32") enum_windows = User32['EnumWindows', 'IPL'] post_message = User32['PostMessage', 'ILILL'] get_class_name = User32['GetClassName', 'ILpI'] name = "IEFrame" buff = " " * 16 WM_CLOSE = 0x0010 TRUE = 1 enum_windows_proc = DL.callback('ILL') {|hwnd,lparam| r,rs = get_class_name.call(hwnd, buff, buff.size) if /^#{name}$/ =~ rs[1].to_s r,rs = post_message.call(hwnd, WM_CLOSE, 0, 0) end TRUE } r,rs = enum_windows.call(enum_windows_proc, 0) -- Shusaku