Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing returning from an external app
Message
De
22/11/2004 15:04:25
 
 
À
22/11/2004 10:12:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00963016
Message ID:
00963611
Vues:
8
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform