🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2004

Re: PeekMessage() - What does this mean?

#2004
From: Martin Seeger
Date: Wed, 16 Dec 1992 03:20
28 lines
1427 bytes
Hi,

>I want to run a long computational loop (for hours!) so I want to use
>PeekMessage() to give the rest of the system a shot at the processor.
>My thought was to use PeekMessage(PM_NOREMOVE) down in the loop and if I
>detected a message to go back to the GetMessage() up at the top.  The
>following quote has me worried though.  What does this really mean?

Looks a little bit complicated to me. I woul do it the following way:

  if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 
  {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
  }

If you use Accelerators you have to insert the appropiated stuff. If you
want to be gently to other applications you replace the "if" withe a
"while". This code works quite well in a application which has to do
a busys waiting for a nasty piece of hardware :-).

Greetings 

   Martin

-- 
Martin Seeger, Hansastrasse 75, 2300 Kiel, Germany, +49 431 81100
>>>>    Unter den Blinden ist der Einaeugige Aussenseiter    <<<<
Technical Details
Message-ID: <ObuLrAdABh107h@maloe.toppoint.de>
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!fub!tpki.toppoint.de!maloe!raider
References: <1992Dec10.012808.29001@odetics.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!math.fu-berlin.de!fub!tpki.toppoint.de!maloe!raider
From: raider@maloe.toppoint.de (Martin Seeger)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: PeekMessage() - What does this mean?
Message-ID: <ObuLrAdABh107h@maloe.toppoint.de>
Date: Wed, 16 Dec 92 03:20:30 GMT
References: <1992Dec10.012808.29001@odetics.com>
Distribution: na
Organization: private UUCP site, Kiel, Germany
Lines: 28