Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Win32::Process Kill Process in Windows ME
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

Report this thread to moderator Post Follow-up to this message
Old Post
Stefan Mueller
04-13-05 01:55 PM


Re: Win32::Process Kill Process in Windows ME
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Sisyphus
04-13-05 01:55 PM


Re: Win32::Process Kill Process in Windows ME
Hello 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

Report this thread to moderator Post Follow-up to this message
Old Post
Stefan Mueller
04-15-05 01:55 PM


Re: Win32::Process Kill Process in Windows ME
"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







Report this thread to moderator Post Follow-up to this message
Old Post
Sisyphus
04-16-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Modules archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:06 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.