Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing returning from an external app
Message
From
22/11/2004 15:04:25
 
 
To
22/11/2004 10:12:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00963016
Message ID:
00963611
Views:
9
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform