Thanks Christian. I have used waitforsingleobject in the past but if you search this forum you will see that in some instances (like calling Adobe Reader and waiting) I have had to switch from using waitforsingleobject to getexitcodeprocess. I have had better luck with getexitcodeprocess in all cases. In most cases it will work fine, but it didn't always work for me. You can search the UT if you are curious. Just my experience.
Tracy
>Hello,
>
>just wanted to show an alternate way to wait for the process to finish ..
>
>CreateProcess ...
>
>
> * waiting until the termination of the program
> DOEVENTS
> DO WHILE .T.
> exitcode = 0
> = GetExitCodeProcess(hProcess, @exitcode)
> IF exitcode # 259
> EXIT
> ENDIF
> = Sleep (100)
> ENDDO
>
>
>should be replacable by a
>
>
>DECLARE INTEGER WaitForSingleObject IN kernel32.dll INTEGER, INTEGER
>lnRetVal = WaitForSingleObject(hThreadHandle,INFINITE)
>
>
>
>which sets the VFP process into an idle waitstate without using any processor resources until the other application finishes ..
>
>Regards
>Christian
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"