Search code examples
winapiwindows-messages

What format is the time member of a MSG structure?


The windows messaging system assigns the post time as a DWORD to every message.

typedef struct tagMSG {
  HWND   hwnd;
  UINT   message;
  WPARAM wParam;
  LPARAM lParam;
  DWORD  time; // <---
  POINT  pt;
} MSG, *PMSG, *LPMSG;

But I can find no documentation indicating what that DWORD represents. Is it seconds, milliseconds, nanoseconds? From what point in history is it counting?


Solution

  • Found it.

    GetMessageTime defines it as the number of milliseconds since the system was started.