The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [OT] - killing a windows process?



>I still seem to be struggling... - is this the "mugs
>game" that you were referring to!?...
Found something I can help with at last!!! And yeah, it is a mugs game....
:-\

Try this instead.. I know it just works, because I've just done it now!
Setup this constant:
Const PROCESS_ALL_ACCESS = &H1F0FFF

>hProcess = OpenProcess(SYNCHRONIZE, 0&, lProcessId)
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&, lProcessId)

The SYNCHRONIZE won't work when you want to terminate a process.

>iReturn = TerminateProcess(hThread, 0)
Follow that with:

Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject
As Long)
As Long
Call CloseHandle(hProcess)
To tidy up the handle created by OpenProcess.

Do that instead... Works lovely on my work NT4 machine and my 98SE at home.

Steve


[Non-text portions of this message have been removed]



http://www.automatedhome.co.uk
Post message: ukha_d@xxxxxxx
Subscribe:  ukha_d-subscribe@xxxxxxx
Unsubscribe:  ukha_d-unsubscribe@xxxxxxx
List owner:  ukha_d-owner@xxxxxxx

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.