Type STARTUPINFO cb As Integer lpReserved As String lpDesktop As String lpTitle As String dwX As Integer dwY As Integer dwXSize As Integer dwYSize As Integer dwXCountChars As Integer dwYCountChars As Integer dwFillAttribute As Integer dwFlags As Integer wShowWindow As Smallint cbReserved2 As Smallint lpReserved2 As Integer hStdInput As Integer hStdOutput As Integer hStdError As Integer End Type
Type PROCESS_INFORMATION
hProcess As Integer
hThread As Integer
dwProcessID As Integer
dwThreadID As Integer
End TypeDeclare Function ExecuteAndWait(cmdLine as string) as integer
Declare Function CloseHandle Lib "kernel32" (hObject As Integer) As smallint
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Integer,ByVal dwMilliseconds As Integer) As Integer
Declare Function CreateProcessA Lib "kernel32"
(ByVal lpApplicationName As Integer,
ByVal lpCommandLine As String,
ByVal lpProcessAttributes As Integer,
ByVal lpThreadAttributes As Integer,
ByVal bInheritHandles As Integer,
ByVal dwCreationFlags As Integer,
ByVal lpEnvironment As Integer,
ByVal lpCurrentDirectory As Integer,
lpStartupInfo As STARTUPINFO,
lpProcessInformation As PROCESS_INFORMATION) As Integer
Function ExecuteAndWait(cmdLine as string) as integer '----------------------- 'Subroutine: 'Called By: 'Description: This subroutine 'Written By: '----------------------- 'Set up general error handler ONERROR GOTO ErrorHandler
Dim nRetVal as integer Dim NameOfProc as Process_Information, NameStart as StartUpInfo
NameStart.cb = 256 NameStart.dwFlags = 1 NameStart.wShowWindow = 0 nRetVal = CreateProcessA(0, cmdLine, 0, 0, 1, NORMAL_PRIORITY_CLASS, 0, 0, NameStart, NameOfProc) nRetVal = NameOfProc.hProcess nRetVal = WaitForSingleObject(NameOfProc.hProcess, INFINITE) nRetVal = CloseHandle(NameOfProc.hProcess)
EXIT FUNCTION
ErrorHandler:
CALL ErrorMessage("ExecuteAndWait")
END FUNCTION 'ExecuteAndWaitOn Tue, 8 Mar 2005 07:47:09 -0500, Peter Powell <[EMAIL PROTECTED]> wrote:
Hello All
Does anybody have Execute and Wait function that was once found via http://www.paris-pc-gis.com/??
Thanks
Peter
--------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 15592
-- ________________________________________________
Robert Crossley
Agtrix P/L 9 Short St PO Box 63 New Brighton 2483 Far Southern Queensland AUSTRALIA
153.549004 E 28.517344 S
P: 02 6680 1309 F: 02 6680 5214 M: 0419 718 642 E: [EMAIL PROTECTED] W: www.agtrix.com W: www.wotzhere.com skype: robertcrossley
--------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 15594
