From: Shashank Date Date: 2003-01-21T22:56:33+09:00 Subject: Re: [WIN] killing a process "Park Heesob" wrote in message > > 1. Under Windows (XP), is there a way to kill a process which is created > > using the system(" ...") call ? > > Use taskmgr.exe Can taskmgr.exe be called from a ruby program without invoking its GUI ? > > 2. How does one use the Windows API: TerminateProcess? > > > > Here is my attempt, assuming pid = 1234 (not sure if I am doing it right): > > > > require 'Win32API' > > > > tp = Win32API.new("kernel32","TerminateProcess",['i','i'],'i') > > tp.call(1234,1) > > > > > Try this: > > OpenProcess = Win32API.new("kernel32","OpenProcess",['L','L','L'],'L') > TerminateProcess = Win32API.new("kernel32","TerminateProcess",['L','L'],'L') > > TerminateProcess.Call(OpenProcess.Call(0x00100001, 0 ,pid),0) I will give it a spin. > Park Heesob Thanks Park !