A WM_USERCHANGED (0x0054) message is sent via BroadcastSystemMessage to all top-level windows, installable drivers, and VxDs when the user logs on or off and user profiles are enabled. An application may determine the current username by calling WNetGetUser.
Most ordinary applications are not affected by logon and logoff, beyond the ordinary implications of active connections being disconnected and open files being closed. The primary purpose of this message is for network-specific applications which maintain internal state based on the current logon. For example, an application which receives messages from other stations might need to add a NetBIOS name (based on the current username) when the user logs on.