Listing 6

using namespace win32::gui::draw;
struct focus_handler 
    : surface::sync_handler<focus_handler,window_base,sync_manual> {
  handle_event on_set_focus() {
    // ... same as before
  }
  handle_event on_kill_focus() {
    // ... same as before
  }
  static std::string sync_name() { return "focus"; }
};