🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #13437

Re: Yield?

#13437
From: Richard Gillmann
Date: Tue, 10 Jan 1989 19:28
12 lines
1104 bytes
In article <33575@grapevine.uucp> parker@grapevine.uucp (Parker Waechter) writes:
>I have a function which basicly does a big for loop on every WM_PAINT
>and I would like it not to hog the cpu the whole time.

There's no simple way to do it.  You can use PeekMessage to process
the queued messages, but I've never found a way which is totally
transparent -- handling accelerator keys is a puzzler.

One alternative is to break your painting into a number of smaller tasks
and do them in response to WM_TIMER messages, with the timer set up by
WM_PAINT.  In this way, other messages can be processed between the
timer messages.
Technical Details
Message-ID: <7218@venera.isi.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!elroy!orion.cf.uci.edu!uci-ics!venera.isi.edu!dick
References: <33575@grapevine.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!elroy!orion.cf.uci.edu!uci-ics!venera.isi.edu!dick
From: dick@venera.isi.edu (Richard Gillmann)
Newsgroups: comp.windows.ms
Subject: Re: Yield?
Keywords: yield, cpu hog, WM_PAINT
Message-ID: <7218@venera.isi.edu>
Date: 10 Jan 89 19:28:20 GMT
References: <33575@grapevine.uucp>
Reply-To: dick@venera.isi.edu.UUCP (Richard Gillmann)
Organization: Information Sciences Institute, Univ. of So. California
Lines: 12