Using the code from strongm thread222-255803, I am trying to kick off GPG to encrypt some data. Unfortunately, I can't figure out how to hide command line window.
Relevant bit of code.
No matter what I do, the dwFlags field does not seem to have any effect (I've tried maximize, minimize, and hide). At first I didn't think I really cared, until I wasn't thinking and closed the command window and the whole app died (taking my IDE with it).
Does anyone have any idea what I'm doing wrong?
Relevant bit of code.
Code:
'*** Start *********************************************************************
'*
'*******************************************************************************
Public Function Start(ByVal strProgram As String) As Long 'PROCESS_INFORMATION_EXT
Dim siStartUp As STARTUPINFO
Dim lResult As Long
siStartUp.cb = Len(siStartUp)
siStartUp.hStdInput = hInReadPipe
siStartUp.hStdOutput = hOutWritePipe
siStartUp.hStdError = hErrorWritePipe
siStartUp.dwFlags = STARTF_USESHOWWINDOW
siStartUp.wShowWindow = SW_HIDE
pStartTime = Now()
lResult = CreateProcessA(vbNullString, strProgram, 0&, 0&, 1&, NORMAL_PRIORITY_CLASS, 0&, vbNullString, siStartUp, pProcess)
If (lResult = 0) Then
'GetLastError
'err.Raise
End If
'Let it initialise properly before continuing (use infinite)
WaitForInputIdle pProcess.hProcess, INFINITE
Start = lResult
End Function
'*** Start *********************************************************************
Does anyone have any idea what I'm doing wrong?