Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing returning from an external app
Message
De
22/11/2004 15:22:20
 
 
À
22/11/2004 15:04:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00963016
Message ID:
00963622
Vues:
8
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                    && initialize return value to 0
>       = GetExitCodeProcess(hProcess, @exitcode)
>     IF exitcode # 259                && not still busy
>         EXIT                            && fall out of loop
>     ENDIF
>     = Sleep (100)                    && wait .1 seconds
>    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"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform