listener_proc (pstruct -w reply, p_program_state -&w state, p_msg msg)
{
  select (msg->message)
  {
    case WM_CREATE:
      ...
    return;

    case WM_DESTROY:
      ...
    return;

    case WM_EVENT:
      ...
    return;

    ...

  }
  else
  {
    ;
  }
}