Compartilhar via


Função WaitMessage (winuser.h)

Bloqueia a execução de thread até que o thread precise processar uma nova mensagem. A nova mensagem pode ser uma mensagem de entrada, uma mensagem na fila ou uma mensagem não enfileirada.

Syntax

BOOL WaitMessage();

Return value

Type: BOOL

Se a função for bem-sucedida, o valor retornado não será zero.

Se a função falhar, o valor retornado será zero. To get extended error information, call GetLastError.

Remarks

Note that WaitMessage does not return for unprocessed messages reported by a previous function which checks the queue. This is because functions such as PeekMessage, GetMessage, GetQueueStatus, WaitMessage, MsgWaitForMultipleObjects, and MsgWaitForMultipleObjectsEx check the queue and then change the state information for the queue so that the message is no longer considered new. A subsequent call to WaitMessage will not return until new messages arrive. As mensagens não processadas existentes (recebidas antes da última vez em que o thread verificou a fila) não são consideradas novas.

Requirements

Requirement Value
Cliente mínimo suportado Windows 2000 Professional [somente aplicativos da área de trabalho]
Servidor mínimo compatível Windows 2000 Server [somente aplicativos da área de trabalho]
Target Platform Windows
Header winuser.h (inclua Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-window-l1-1-4 (introduzido no Windows 10, versão 10.0.14393)

See also

Conceptual

GetMessage

mensagens e filas de mensagens

PeekMessage

Reference