home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4329 < prev    next >
Encoding:
Internet Message Format  |  1992-12-18  |  1.4 KB

  1. Path: sparky!uunet!math.fu-berlin.de!fub!tpki.toppoint.de!maloe!raider
  2. From: raider@maloe.toppoint.de (Martin Seeger)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: PeekMessage() - What does this mean?
  5. Message-ID: <ObuLrAdABh107h@maloe.toppoint.de>
  6. Date: Wed, 16 Dec 92 03:20:30 GMT
  7. References: <1992Dec10.012808.29001@odetics.com>
  8. Distribution: na
  9. Organization: private UUCP site, Kiel, Germany
  10. Lines: 28
  11.  
  12. Hi,
  13.  
  14. >I want to run a long computational loop (for hours!) so I want to use
  15. >PeekMessage() to give the rest of the system a shot at the processor.
  16. >My thought was to use PeekMessage(PM_NOREMOVE) down in the loop and if I
  17. >detected a message to go back to the GetMessage() up at the top.  The
  18. >following quote has me worried though.  What does this really mean?
  19.  
  20. Looks a little bit complicated to me. I woul do it the following way:
  21.  
  22.   if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 
  23.   {
  24.     TranslateMessage(&msg);
  25.     DispatchMessage(&msg);
  26.   }
  27.  
  28. If you use Accelerators you have to insert the appropiated stuff. If you
  29. want to be gently to other applications you replace the "if" withe a
  30. "while". This code works quite well in a application which has to do
  31. a busys waiting for a nasty piece of hardware :-).
  32.  
  33. Greetings 
  34.  
  35.    Martin
  36.  
  37. -- 
  38. Martin Seeger, Hansastrasse 75, 2300 Kiel, Germany, +49 431 81100
  39. >>>>    Unter den Blinden ist der Einaeugige Aussenseiter    <<<<
  40.