Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!hplabs!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.HP.COM (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: Yield? Message-ID: <106580013@hpcvlx.HP.COM> Date: 9 Jan 89 17:42:51 GMT References: <33575@grapevine.uucp> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 23 > how does one use the Yield call? One doesn't. If your application has windows, then Yield is a no-op. If you want to yield control, you must empty the message queue. That means either calling GetMessage to empty the queue (and block till a message arrives), or using PeekMessage. Thus, you can do something like: while (more processing required) { do processing; while (PeekMessage(&msg, hWnd, 0, 0, TRUE)) { TranslateMessage(&msg); DispatchMessage(&msg); } } You do *NOT* want to throw away the messages comming in during this loop, so you have to be careful of reentrancy problems. As far as I know, this is the only way to yield during message processing. --Bill Turner