in reply to Re: End a process in the Task manager
in thread End a process in the Task manager

Thank u very much. If I were to use Win32::API how will i get the process id? If I do
use Win32::API; Win32::API->Import("kernel32", "int GetCurrentProcessId()"); $PID = GetCurrentProcessId();
I get the process id of the current process. But what if I want to kill some other process? For example If I open an Excel application and want to forcefully kill that process, how do i get the PID of it.
Please send me some sample code to do it.

Replies are listed 'Best First'.
Re^3: End a process in the Task manager
by spurperl (Priest) on Jun 03, 2005 at 10:21 UTC
    I don't have the full code, but the EnumWindows API function may be of help.
      how do I use Enum Windows API function in perl?
        Never actually did this, but any reason for it to be different from any other call ? Look up EnumWindows in MSDN (online, if you want) and see what arguments it expects, what it returns, etc. Then use the import capability Win32::API provides to call it.