Path: 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 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.