Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!janus.Berkeley.EDU!kipnis From: kipnis@janus.Berkeley.EDU (Gary Kipnis) Newsgroups: comp.windows.ms Subject: timer for windows Message-ID: <33605@ucbvax.BERKELEY.EDU> Date: 11 Jan 90 19:16:56 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: kipnis@janus.Berkeley.EDU (Gary Kipnis) Organization: University of California, Berkeley Lines: 25 Hi, a while back someone suggested using the following method to implement a timer in windows: void FAR PASCAL Sleep(hWnd, wMilliSeconds) HWND hWnd; WORD wMilliSeconds; { MSG Msg; SetTimer(hWnd, TIMER_ID, wMilliSeconds, NULL); GetMessage(&Msg, hWnd, WM_TIMER, WM_TIMER); KillTimer(hWnd, TIMER_ID); return; } For some reason after making a call to this function several time the system hangs. If I eliminate this function from the code then everything works fine (without a delay though). Does anyone have any ideas what might be wrong with the above method or suggest a different approach. Thank you, gary