What's the meaning of the parameter, lPrivate, in the MSG structure?

StreamingMoon 60 Reputation points
2026-07-06T03:28:34.9266667+00:00

(https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg

The link above is the document about MSG structure.)

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

According to the article, we could notice that, the seventh parameter, lPrivate, has no any explanation about it.

User's image

It's rare, because even if something is protected or meaningless now, the Microsoft's document would point that out, but nothing about lPrivate.

What we could know is only that it is a DWORD.

So, what's the actual meaning of lPrivate?

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

0 comments No comments

1 answer

Sort by: Most helpful
  1. RLWA32 52,676 Reputation points
    2026-07-06T08:27:35.4033333+00:00

    It seems that the Windows documentation doesn't accurately reflect the MSG structure as seen in the Windows SDK headers.

    From a real winuser.h -

    /*
     * Message structure
     */
    typedef struct tagMSG {
        HWND        hwnd;
        UINT        message;
        WPARAM      wParam;
        LPARAM      lParam;
        DWORD       time;
        POINT       pt;
    #ifdef _MAC
        DWORD       lPrivate;
    #endif
    } MSG, *PMSG, NEAR *NPMSG, FAR *LPMSG;
    
    

    As you can see, the lPrivate member only exists if _MAC is defined.

    The historical discussion of this macro can be found at https://stackoverflow.com/questions/2376478/whats-with-ifdef-mac-in-windows-header-files

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.