Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stop a scan
Message
From
27/02/2013 18:27:41
 
 
To
27/02/2013 17:19:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01567088
Message ID:
01567102
Views:
76
>VFP9SP2
>I would like to conditionaly stop a scan. The easiest way would be to {set escape on} and invoke the ESC key. However the application rules that 'settings' should not be used. Do we have an other option?


Launch a separate process which presents a form with a "Cancel operation" button. Use BindEvent() to send messages back and forth to each other's HWND. Every 10th or 100th iteration on your SCAN, do a DOEVENTS (or DOEVENTS FORCE). Pass the HWND value of your first form as a command line parameter to the called process. It will use BindEvent() on custom messages you'll send from the first/master process. The first thing it does after loading is send a message back saying "I'm up and running," and then you can have two way communication. When your SCAN..ENDSCAN block completes, send it the terminate message to close the separate process. If the user clicks the "Cancel operation" button, send your SCAN..ENDSCAN process the "the user wants to cease" operation.

You can see a sample of how this works: https://github.com/RickCHodgin/guithread

To run, go to the "master" directory and type "do go".
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform