public bool Notify(NotifyData Notify) { try { NotifyInstance = new frmNotify(Notify); NotifyInstance.Show(); return(true); } catch (Exception e) { Notify.Failed?.Invoke(e); return(false); } }
public frmNotify(NotifyData notify) { InitializeComponent(); if (notify.Icon == null) { notify.Icon = Properties.Resources.NotifyIcon; } if (notify.OnSound) { Stream stream = Properties.Resources.NotifySound; SoundPlayer snd = new SoundPlayer(stream); snd.Play(); } this.Source = notify; // TopMost SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); EnterX = 360; this.FormBorderStyle = FormBorderStyle.None; this.PrepareDrawing(); }