Win_PeekMessage

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > UI (User Interface) > Windows API >

Win_PeekMessage

 

Description

 

Retrieves a message from the calling thread's message queue.

The function dispatches incoming sent messages until a posted message is available for retrieval.

 

Syntax

 

n = Win_PeekMessage(tagMSG, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg)

 

Returns

 

Number.

If a message is available, the return value is nonzero.

If no messages are available, the return value is zero.

 

Parameters

 

Name

Type

Optional

Meaning

tagMSG

Variable

No

A pointer to an TAGMSG structure that receives message information from the thread's message queue

hWnd

Number

No

A handle to the window whose messages are to be retrieved. The window must belong to the current thread.

wMsgFilterMin

Number

No

The integer value of the lowest message value to be retrieved

wMsgFilterMax

Number

No

The integer value of the highest message value to be retrieved

wRemoveMsg

Number

No

Specifies how messages are to be handled. This parameter can be one or more of the following values:

 

%PM_NOREMOVE

Messages are not removed from the queue after processing by Win_PeekMessage.

 

%PM_REMOVE

Messages are removed from the queue after processing by Win_PeekMessage.

 

%PM_NOYIELD

Prevents the system from releasing any thread that is waiting for the caller to go idle (see WaitForInputIdle).

Combine this value with either %PM_NOREMOVE or %PM_REMOVE.

 

 

Remarks

 

For additional info, please refer to MS documentation at: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644943(v=vs.85).aspx

 

Restrictions

 

See also

 

Examples