|
-
May 6th, 2000, 03:58 PM
#1
Why does the following code work in Win98 but NOT NT? What do I have to change to have it work on both OSs?
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessID As Long) As Long
Public Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Public Sub runshell(cmdline$)
Dim hProcess As Long
Dim ProcessId As Long
Dim exitCode As Long
ProcessId& = Shell(cmdline$, vbNormalFocus)
hProcess& = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessId&)
Do
Call GetExitCodeProcess(hProcess&, exitCode&)
DoEvents
Loop While exitCode& > 0
End Sub
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
|