need help to translate this lines to PB
Code: Select all
Private Type STARTUPINFOW
cbSize As Long
lpReserved As Long
lpDesktop As Long
lpTitle As Long
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 Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Public Sub StartProcess(ByVal sPath As String)
Dim tSi As STARTUPINFOW <-- please tranlate to PB
Dim tPi As PROCESS_INFORMATION
Dim lR As Long
Dim lErr As Long
' Must set the desktop to run on in the
' STARTUPINFO structure:
tSi.cbSize = Len(tSi)
tSi.lpTitle = StrPtr(m_sDesktop) <-- please tranlate to PB
tSi.lpDesktop = StrPtr(m_sDesktop)
lR = CreateProcess( _
StrPtr(sPath), ByVal 0&, ByVal 0&, ByVal 0&, _
1, 0, ByVal 0&, ByVal 0&, tSi, tPi)
If (lR = 0) Then
lErr = Err.LastDllError
' Make sure we get back into the desktop
' that contains the application that is
' using this class:
ClearUp
' Now show the error
'ApiErrorHandler lErr, True
Else
' Wait until the process has completed:
' WaitForSingleObject tPi.hProcess, INFINITE
' Done. Not sure if we need to close these
' handles, but it doesn't cause a problem
CloseHandle tPi.hProcess
CloseHandle tPi.hThread
' Once no more processes are running on
' the desktop it will automatically
' close.
End If
End Sub