` Running a process in the background (Lee White ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Running a process in the background
2004-12-20 -- Lee White
 
What I've always done in cases where I want a background process to STAY in the background is to start it on its own thread when the app is loaded. I then put it to sleep and wake it up whenever it's needed by setting the TIMER on the hidden window. --global equates-- EVENT:Sleep EQUATE(500h) EVENT:Wake EQUATE(501h) MyProc PROCEDURE Window Window...Timer(1) END CASE EVENT() OF EVENT:OpenWindow POST(EVENT:Sleep) OF EVENT:Sleep 0{PROP:Timer} = 0 OF EVENT:Wake < do any housekeeping here > 0{PROP:TImer} = 1 OF EVENT:Timer < do processing > ... END When needed, simply POST(EVENT:Wake,,). This way the window is always open and doesn't grab focus from other windows in your app or other apps.


Today is April 26, 2024, 3:53 pm
This article has been viewed 35111 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: