When in NT or Windows 95, use the Sleep API function instead of DoEvents.DoEvents does this:
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg);}
DoEvents spends part of its time watching for other messages in thesame process. This behavior has no value in a preemptive-multitasking operatingsystem. Sleep yields more efficiently to other processes. Sleep is declaredas:
Public Declare Sub Sleep Lib "kernel32" _ Alias "Sleep" (ByVal dwMilliseconds As Long)
and can be called as:
Sleep 0&