Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
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 GetTickCountfunction. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

When a thread calls the GetMessagefunction 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 GetTickCountjust before or just after calling GetMessageQueueReadyTimeStamp. If the return value of GetMessageQueueReadyTimeStampis not zero, the difference between the return values from GetMessageQueueReadyTimeStampand GetTickCountapproximates 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