How do i know the time a program is active, started with shell in VB5 
Author Message
 How do i know the time a program is active, started with shell in VB5

Module code as follows. This works for me. Thanks to whoever sent this to
me, I'm sorry but I can't remember your name inorder to give you the credit.

Option Explicit
Public Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As
Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function GetModuleUsage Lib "Kernel32" Alias
"GetModuleUsageW" (ByVal bModule As Integer) As Integer
Public Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As
Long, lpExitCode As Long) As Long

Public Const STILL_ACTIVE = &H103

Public Function ShellExec(EXEPathandFile As String, ByVal Status As
VbAppWinStyle) As Integer
Dim hProc As Long, hshell As Long, lproc As Long, x As Long
hshell = Shell(EXEPathandFile, Status)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hshell)
    GetExitCodeProcess hProc, lproc&
Loop While lproc = STILL_ACTIVE
ShellExec = (hshell > 0)
End Function

Sun, 03 Sep 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Active program: keeping the app active and checking time

2. tell another program i am done

3. Please Help How does the program know when the Music is done

4. how to creat a program group/icons in start/programs in VB5

5. Length of time shell is active

6. Stopping a Program Started with Shell

7. terminate program started using shell

8. Please help: redirecting output of shell started program

9. Terminating a program started with the SHELL statement

10. Closing a program started with SHELL

11. Help : how to know shelled program finished ?


Powered by phpBB® Forum Software