Table of Contents

Event types

[tbd]

Event propagation

Basic principles

[tbd]

Focus event

  enum FOCUS_EVENTS
  {
      FOCUS_LOST = 0,
      FOCUS_GOT = 1,
  };
 
  struct FOCUS_PARAMS
  {
      UINT      cmd;            // FOCUS_EVENTS
      HELEMENT  target;         // target element, for FOCUS_LOST it is a handle 
                                // of new focus element and for FOCUS_GOT it is 
                                // a handle of old focus element, can be NULL
      BOOL      by_mouse_click; // TRUE if focus is being set by mouse click
      BOOL      cancel;         // in FOCUS_LOST phase setting this field to TRUE
                                // will cancel transfer focus from old element 
                                // to the new one.
  };

Let's assume that some element A already has focus and another element B is getting focus. While setting focus engine sends FOCUS_LOST and FOCUS_GOT events in the following sequence:

First:

Second:

Third:

Rationale:

While processing these events applications knows what element is loosing focus and what element is getting focus.