Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ncrlnk!emdeng!sshirk From: sshirk@emdeng.Dayton.NCR.COM (Stephanie.Shirk) Newsgroups: comp.windows.ms Subject: Yielding control Message-ID: <291@emdeng.Dayton.NCR.COM> Date: 21 Mar 90 15:31:15 GMT Reply-To: sshirk@emdeng.UUCP (Stephanie.Shirk) Organization: NCR, E&M Dayton Lines: 36 Has anyone tried forcing an application to yield control to others? You're supposed to be able to do this by calling PeekMessage or GetMessage (even outside your message loop). I'm not having much luck! I'm also trying to do this from a DLL, which means I don't have access to the handle of the window of the application currently in the DLL (although there probably is some way to get that, too). Some of the things I've tried include: -- Yield(), which is actually defined to be used only by Windows applications that don't use windows (thanks a lot!). It didn't do anything. -- PeekMessage() without removing a message, which didn't do anything. -- Calling PostAppMessage() with a WM_USER message (this function lets you use the task handle instead of requiring the window handle). Then calling PeekMessage() with a -1 handle (as defined). PeekMessage returned 0 (no message found) and did not yield control. -- Calling PostAppMessage as above and then calling GetMessage with a NULL handle. It returned nonzero but did not yield control. (I didn't check yet to see if anything showed up in my message structure.) The SDK doc didn't say anything about using a -1 handle like it did for PeekMessage. I also tried PeekMessage with a NULL window handle and removing any message. This sort of worked at first (I managed to click on another window but that was about it). Of course that probably isn't a good way to do it anyway. Thanks for any ideas you have! Stephanie Shirk -- NCR E&M-Dayton email: sshirk@emdeng.Dayton.NCR.COM -- Stephanie Shirk -- NCR E&M Dayton e-mail: sshirk@emdeng.Dayton.NCR.COM