Article View: borland.public.cppbuilder.nativeapi
Article #11829Re: problem with TerminateProcess and user rights
From: Remy Lebeau (TeamB)
Date: Sun, 11 Jan 2004 21:25
Date: Sun, 11 Jan 2004 21:25
29 lines
2309 bytes
2309 bytes
"saso badovinac" <none@none.com> wrote in message news:40012fee$1@newsgroups.borland.com... > :( sorry i am new to this newsgroups and yes it is true that i have > post the question several times since i didnt know what would > the right newsgroup for the problem. That would be this group. > yes i saw your repy now and did test the return values now but > they didnt help me much further as to confirm that i am only able > to openproces and terminate it if the user is the same If OpenProcess() fails, it returns NULL and GetLastError() tells you exactly why it could not open the process. If TerminateProcess() fails, it retuns FALSE and GetLastError() tells you exactly why it could not terminate the process. BTW, as long as I am thinking about it, I have to ask - what kind of process exactly are you trying to terminate in the first place? Under most situations, use of TerminateProcess() is discouraged, it should only be used as a last resort when nothing else works. More times than not, there are other, more elgant, ways to stop a given process. So please provide more details about what exactly you are trying to accomplish. Gambit
Technical Details
Message-ID:
<4001bdcd$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed.news2me.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp5.savvis.net!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<4000a4a8@newsgroups.borland.com> <4000acee$1@newsgroups.borland.com> <40012fee$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,6dea0870157ee61c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-11 13:30:16 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4000a4a8@newsgroups.borland.com> <4000acee$1@newsgroups.borland.com> <40012fee$1@newsgroups.borland.com> Subject: Re: problem with TerminateProcess and user rights Date: Sun, 11 Jan 2004 13:25:15 -0800 Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.138.253 Message-ID: <4001bdcd$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1073855949 67.22.138.253 (11 Jan 2004 13:19:09 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed.news2me.com!newshosting.com!news-xfer1.atl.newshosting.com!nntp5.savvis.net!newsfeed.frii.net!newsfeed.frii.net!news.compaq.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail