Who Generates Which Events?

[This is preliminary documentation and subject to change.]

There are two classes of events, system level and object level, each with a corresponding event constant value. System-level events describe situations affecting all applications in the system, whereas object-level events pertain to situations specific to an object or objects within one application. System-level event values are macro values whose labels begin with EVENT_SYSTEM; object-level event values begin with EVENT_OBJECT.

Server applications and the operating system both generate WinEvents. The operating system generates both system- and object-level events for systemwide notifications about focus changes, activation changes, system alerts, or for events regarding system objects like common controls. Server applications typically generate object-level events regarding the accessible objects they contain, notifying clients about object creation, destruction, selection, or other object-level events. Remember that the server application should minimize sending redundant messages.

In some cases, server applications will send system-level events. For example, when an application displays a message box by calling the MessageBox Win32 function, the system generates the EVENT_SYSTEM_ALERT system-level event. However, if a server application displays an alert box on its own (without calling MessageBox) it should generate an EVENT_SYSTEM_ALERT event on behalf of the custom window.