Listing 2

// taken from children_all_area.cpp
struct children_all_area_handler : ... {
  // [1] Defining the custom event
  enum {
    // what if this event ID already exists?
    // ... could get into trouble...
    WM_AFTER_CREATE = WM_USER + 113
  };

  // [2] Handling the custom event
  //
  // Note: expects the child to be passed as LPARAM
  handle_event on_create(l_param<HWND> child) {
    ...
    return event<WM_AFTER_CREATE>().HANDLED_BY(&me::on_create);
  }
  
  // [3] Posting a custom event + its arguments
  //
  // Note: you need to match the arguments you send with
  //       the event handler function that processes it
  post_msg( WM_AFTER_CREATE, 0, (HWND)child);

  // ...
};