Hallo Mr. Fox,
habe den C++Source in VB umgesetzt und es hin und her probiert, leider ohne richtigen Erfolg.
'Sample04
Option Explicit
Public Const SW_NORMAL = 1
Public Const STARTF_USESTDHANDLES = &H100&
Public Const STARTF_USESHOWWINDOW = &H1
Public Const NORMAL_PRIORITY_CLASS = &H20
Public Const WAIT_TIMEOUT As Long = 258&
Public Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Byte
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Public Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Public Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
'lpPipeAttributes As SECURITY_ATTRIBUTES durch as Any ersetzt
Public Declare Function CreatePipe Lib "kernel32" ( phReadPipe As Long, _
phWritePipe As Long, lpPipeAttributes As Any, _
ByVal nSize As Long) As Long
Public Declare Function ConnectNamedPipe Lib "kernel32" ( ByVal hNamedPipe As _
Long, _
lpOverlapped As Any) As Long
Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" ( _
ByVal lpApplicationName As Long, ByVal lpCommandLine As String, _
ByVal lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As Long
Public Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, _
lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As Long, ByVal Overlapped As Any) As Long
Public Declare Function CloseHandle Lib "kernel32" ( _
ByVal hObject As Long) As Long
Public Declare Function WaitForSingleObject Lib "kernel32" ( _
ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long Fortsetzung des Sources im Folgebeitrag (sonst zu lang) |