Partager via


GetMessageQueueReadyTimeStamp

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function retrieves the time at which a specified thread was last ready to process a message.

Syntax

DWORD WINAPI GetMessageQueueReadyTimeStamp(
  HWND hWnd
);

Parameters

  • hWnd
    [in] Handle to a window that is owned by the thread you want to query.

Return Value

The time, expressed as the number of milliseconds that have elapsed since the operating system was started, at which the thread was last ready to process a message. If the thread is idle and waiting to receive a message to process, the return value is the same as the return value of the GetTickCount function. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

When a thread calls the GetMessage function on the message queue for the thread, the thread enters the blocked state until a message is ready to process. When a message becomes available in the message queue, the thread leaves the blocked state and receives a time stamp that is obtained by calling GetTickCount. The time stamp resets to the current time only when the thread returns to the idle state.

To determine the amount of time that has elapsed since a thread was last ready to process a message, call GetTickCount just before or just after calling GetMessageQueueReadyTimeStamp. If the return value of GetMessageQueueReadyTimeStamp is not zero, the difference between the return values from GetMessageQueueReadyTimeStamp and GetTickCount approximates the length of time that the thread has taken to be ready to process the next message.

Requirements

Header windows.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

Message Queue Functions
GetMessage

Other Resources

GetTickCount