If your window has several different messages to handle and uses several different functions to handle these messages, it's better to use EV_CHILD_NOTIFY_AND_CODE instead of evchildnotify because EV_CHILD_NOTIFY message-handling function receives no parameters and therefore doesn't know which message it's handling.