Code Comments
Programming Forum and web based access to our favorite programming groups.Hello, I want to kill a Process in Windows ME, which I have started. I have executed the following lines in XP and it works. I execute this in ME, the process starts but it won't be killed. Win32::Process::Create($ProcessObj, "C:\\Program Files\\Internet Explorer\\iexplorer.exe", "iexplore temp.txt", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); $ProcessObj->Kill(1); Is there a possibility to kill processes in Windows ME? Thanks in advance. Stefan
Post Follow-up to this message"Stefan Mueller" <s1210197@yahoo.de> wrote in message news:f35b4d73.0504122349.79560db0@posting.google.com... > Hello, > > I want to kill a Process in Windows ME, which I have started. I have > executed the following lines in XP and it works. I execute this in ME, > the process starts but it won't be killed. > What actually happens ? Does the script hang .... or exit silently .... or .... ? Do you get any warnings or error messages ? use warnings; > Win32::Process::Create($ProcessObj, > "C:\\Program Files\\Internet > Explorer\\iexplorer.exe", > "iexplore temp.txt", > 0, > NORMAL_PRIORITY_CLASS, > ".")|| die ErrorReport(); > Not sure. Maybe (untested): my $exitcode; my $pid = $ProcessObj->GetProcessID(); Win32::Process::KillProcess($pid, $exitcode); # $exitcode is set to the exitcode of the process. Cheers, Rob -- To reply by email send to optusnet.com.au instead of nomail.afraid.org
Post Follow-up to this messageHello Rob, Thank you for your answer. "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message news:<425ce4a5$0$29868$afc38c87@n ews.optusnet.com.au>... > What actually happens ? Does the script hang .... or exit silently .... or > .... ? > Do you get any warnings or error messages ? No, I get no error messages. The script doesn't hang, it exists like the way on XP. > use warnings; no warnings > Not sure. Maybe (untested): > > my $exitcode; > my $pid = $ProcessObj->GetProcessID(); > Win32::Process::KillProcess($pid, $exitcode); > # $exitcode is set to the exitcode of the process. it's the same. What's about the exitcode? I have used 1 and 9, but there is no difference. Cheers, Stefan
Post Follow-up to this message"Stefan Mueller" <s1210197@yahoo.de> wrote in message news:f35b4d73.0504142300.553dc396@posting.google.com... > Hello Rob, > > Thank you for your answer. > > "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message news:<425ce4a5$0$29868$afc38c87@news.optusnet.com.au>... or > > No, I get no error messages. The script doesn't hang, it exists like > the way on XP. > I can't find any documented reason for the problem (and I don't actually have a Windows ME to experiment with). KillProcess() calls OpenProcess() and TerminateProcess(). I've checked the msdn docs for both OpenProcess and TerminateProcess and there's no mention of any special considerations regarding Windows ME. If you want (and assuming you can compile Win32::Process from source) you could try changing (in Process.xs): HANDLE ph = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); to: HANDLE ph = OpenProcess(PROCESS_TERMINATE, 0, pid); (You'll find that about 5 or 6 lines from the end of the file.) I can't really think of any reason that should help, however. ActiveState now hosts a (low volume) libwin32-perl mailing list. Maybe someone there can help. See: http://aspn.activestate.com/ASPN/Mail/ Cheers, Rob
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.