Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateProcessA won't hide spawned process

Status
Not open for further replies.

Kavius

Programmer
Apr 11, 2002
322
0
0
CA
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.
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 *********************************************************************
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top