hport _ = create_port (&listener),
{
  listener = {
               port_message_filter : (text_box) <> {
                                                     ...
                                                   }
             }
};

evt_reply reply = send_message (&_, port, WM_EVENT, event_id, 0);