Thanks Ralph thats very helpful, Ive checked all of those examples and tried
them.
What happens is that I just want to get the exit code when the called exe
terminates and either Im not doing this right or the app itself is not
returning the various exit codes
in my code,
GetExitCodeProcess proc.hProcess, RetVal2
RetVal2 is always -1 but then if I change it to
RetVal = GetExitCodeProcess (proc.hProcess, RetVal2)
and assume that proc.hProcess works fine, it starts and I can see the
process number in the task manager associated with my expected exe
application that Im starting up
then here RetVal is always = 0
In the various sample programs, they seem to all use similar if not
identical calls to kernel32 functions. So now Im left wondering if the
application doesnt actually return various exit codes, or Im not doing the
right thing to discover them. Contacting the person responsible for the app
itself, I get an out of office reply...
> > first I hope this is an okay question for this ng?
> >
[quoted text clipped - 32 lines]
> Another...
> http://www.vbaccelerator.com/home/vb/code/libraries/Shell_Projects/Shell_And_Wai
t_For_Completion/article.asp
Bradley1234 - 27 Nov 2007 21:18 GMT
Ok I figured it out, using one of the original main links I followed it out
and found it,
http://support.microsoft.com/kb/129796/EN-US/
quote...
Getting the Exit Code from the Shelled Application
It was common for a DOS application to return an exit code indicating the
status of the completed application. While Windows provides other ways to
convey the same information, some applications only provide exit codes.
Passing the process handle to the GetExitCodeProcess() API allows you to
retrieve this information.
I made a new app, copied and pasted the example, inserted my app for notepad
and it works perfect
Using this, it also shows that the app in question returns code 0 all the time
thanks
> Thanks Ralph thats very helpful, Ive checked all of those examples and tried
> them.
[quoted text clipped - 59 lines]
> > Another...
> > http://www.vbaccelerator.com/home/vb/code/libraries/Shell_Projects/Shell_And_Wai
t_For_Completion/article.asp