Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>peekmessage()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
PeekMessage()
Check for a message from Windows
------------------------------------------------------------------------------

Syntax
#include "msg.ch"
PeekMessage( <aMsg>, [ <hWnd> ] , [ <nMin> ] , [ <nMax> ] ,
             [ <nRemove> ] )     -->   lContinue

Arguments
<aMsg> is the array to contain the message.  It must be at
least MSG_LENGTH in length.

<hWnd> optionally specifies the window whose messages are
wanted.  The default is all windows owned by the application.

<nMin>, <nMax> optionally specify the range of messages (WM_*
values) to be fetched.  The default is all messages.

<nRemove> is one of the PM_* values in WINDOWS.CH.  The
default is PM_NOREMOVE.

Returns
A logical TRUE (.T.) is returned if a message is available.

Description
This function allows Clip-4-Win applications to be programmed
in the "traditional" manner of Windows applications, if you wish.

It can also be used to allow Windows to multi-task when your
application is too busy to fetch events/messages using
ChkEvent() / GetMessage().

Example
#include "msg.ch"
local     aMsg[MSG_LENGTH]

lBusy := .T.
do while  lBusy
     PeekMessage( aMsg )
     // .
     // .  ( something that takes a long time, but eventually
     // .    sets lBusy to .F. )
     // .
enddo

See Also: DispatchMessage() GetMessage() TranslateMessage()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson