Application.ProcessMessages;<br>虽然不会造成完全死掉,但是它占用了大部分的CPU,<br>在不停的进行查询消息队列<br><br>如下面的代码,运行后,鼠标都动不了了<br>var<br> t, t1, t2: Integer;<br> Msg: TMsg;<br>begin<br> SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);<br> SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL);<br> t1 := GetTickCount;<br> t := t1;<br><br> while GetTickCount - t1 < 8000 do<br> begin<br> t := t + 1;<br> end;<br><br> SetPriorityClass(GetCurrentProcess, NORMAL_PRIORITY_CLASS);<br> SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_NORMAL);<br> ShowMessage('ok:' + IntToStr(t));<br><br>但是,如果你把循环中的代码改成,我前面所说的一些函数,<br>可能程序自己会没有反应,但别的进程就正常了