The sample AlarmEventViewer shows we can filter alarm when use GetAlarmLines in IAlarmClient. But for the real-time alarm,it seems we should filter alarms in the callback NewAlarmMessageHandler. Can I set any parameter when register the callback,then the callback only triggered by the special alarm type?
No, you describe the mechnism accurately and cannot set a filter on the alarms type by the NewAlarmIndication.
You could implement an Event Server plugin which could use your own message, so that your Event Server plugin signals the wanted type of alarms to your application. In this way the alarm filtering can be a achieved in the Event Server and not need to travel unnecessary to the application.