|
-
Apr 10th, 2001, 12:42 AM
#1
I want to terminate a process by its process id. I have tried with openprocess() & terminateprocess(). But its not working. I am giving u the code which i tried.
Dim processid As Long
Dim processhandle As Long
Dim lExitCode As Long
processid = Shell("C:\winnt\system32\notepad.exe", vbMinimizedFocus)
processhandle = OpenProcess(PROCESS_ALL_ACCESS, 0&, processid)
GetExitCodeProcess processhandle, lExitCode
TerminateProcess processhandle, lExitCode
Its not working bcos terminateprocess is taking processhandle(it becomes 0 as soon as it opens notepad.exe) , but i want to terminate the notepad.exe . How to do that? Can u help me in this regard?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|