Listing 4: Der Einsatz von ApplicationMsg struct MsgPort *port; struct ApplicationMsg *msg; BOOL running = TRUE; IApplication->GetApplicationAttrs(appID,APPATTR_Port,&port,TAG_DONE); while(running) { IExec->WaitPort(appPort); while((msg = (struct ApplicationMsg *) IExec->GetMsg(appPort))) { switch(msg->type) { case APPLIBMT_Quit: running = FALSE; break; } IExec->ReplyMsg((struct Message *)msg); } }