Fungsi WaitMessage (winuser.h)

Memblokir eksekusi utas hingga utas perlu memproses pesan baru. Pesan baru dapat berupa pesan input, pesan antrean, atau pesan yang tidak diantrekan.

Syntax

BOOL WaitMessage();

Return value

Type: BOOL

Jika fungsi berhasil, nilai yang dikembalikan bukan nol.

Jika fungsi gagal, nilai yang dikembalikan adalah nol. 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. Pesan yang tidak diolah yang ada (diterima sebelum terakhir kali utas memeriksa antrean) tidak dianggap baru.

Requirements

Requirement Value
Klien minimum yang didukung Windows 2000 Professional [hanya aplikasi desktop]
Server minimum yang didukung Windows 2000 Server [hanya aplikasi desktop]
Target Platform Windows
Header winuser.h (termasuk Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-window-l1-1-4 (diperkenalkan di Windows 10, versi 10.0.14393)

See also

Conceptual

GetMessage

Pesan dan Antrean Pesan

PeekMessage

Reference