Monday, October 09, 2006

DoEvents() In API

I used to use DoEvents() function in the Application class whenever i did the code. But problem arised when i wanted to use it inside a dll. Had no other options but to emulate the DoEvents function using API calls.

Here is the sample implementation.


public static void DoEvents()
long holdTime = GetTickCount();
int i = 0;
while ((GetTickCount() - holdTime)<1000) message ="="">