public TrayDeskband getTrayDeskband() { if (this.traydeskband != null && Marshal.IsComObject(this.traydeskband)) { return(this.traydeskband); } Type deskbandType = System.Type.GetTypeFromCLSID(new Guid("E6442437-6C68-4f52-94DD-2CFED267EFB9")); try { this.traydeskband = (TrayDeskband)Activator.CreateInstance(deskbandType); return(this.traydeskband); } catch (Exception exception) { MessageBox.Show(exception.Message); } return(null); }
private static string CheckOrShowDeskBand() { Guid notebarGuid = new Guid(Constants.NoteBarGuid); using (var trayDeskband = new TrayDeskband()) { if (trayDeskband.IsDeskBandShown(notebarGuid)) { return(null); } var showResult = trayDeskband.ShowDeskBand(notebarGuid); if (!showResult) { return("NoteBar not installed"); } return(trayDeskband.IsDeskBandShown(notebarGuid) ? null : "You have to turn NoteBar on"); } }