private static List <NOTIFYITEM> getTrayItems(TrayNotify instance) { NotificationCb callback = new NotificationCb(); ulong handle = 0UL; ITrayNotify notify1 = (ITrayNotify)instance; notify1.RegisterCallback(callback, out handle); notify1.UnregisterCallback(handle); return(callback.items); }
public void Dispose() { if (notifier != null) { try { notifier.UnregisterCallback(handle); Marshal.ReleaseComObject(notifier); } catch (Exception e) { throw new Exception("Could not unregister callback", e); } } }