🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #13912

timer for windows

#13912
From: Gary Kipnis
Date: Thu, 11 Jan 1990 19:16
25 lines
1098 bytes
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
Technical Details
Message-ID: <33605@ucbvax.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!janus.Berkeley.EDU!kipnis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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