SD> Q: Is it possible to disallow Windows interrupting my program ?
SD> -----------------------------------------------------------------
SB> What exactly are you trying to do that is so critical it not be
SB> desturbed?
Horizontal scroll area for displaying advertisments/messages that
are going to be mixed with TV signal and broadcasted.
SB> windows tasks will not get any time. Second, if you are using Delphi
SB> 2.0, you must remember that Win95 and WinNT are multitrheaded which
SB> means other stuff will be running.
Well, I have found the solution - it is so selfdocumenting:
curProcess := GetCurrentProcess();
SetPriorityClass(curProcess, REALTIME_PRIORITY_CLASS);
curThread := GetCurrentThread();
SetThreadPriority(curThread, THREAD_PRIORITY_TIME_CRITICAL);
There is a huge remark in WIN 32 API help saying that this method
will "kill" other processes and I've found it's true: while my
program does scroll (un-idle WHILE loop), _everything_ in
background stops.
Task-switching in W95 won't work, disk is quiet, mouse is dead,
XT again! :-)
Srdjan
--- Platinum Xpress/Win/Wildcat5! v2.0GU
(1:3618/555)
---------------
* Origin: The NeverEnding BBS-Deltona FL 904-789-8383/neverending.com
|