public void TestCreateTable() { try { Inspector.Clear(); var specService = new SpecService(new SpecTest()); specService.CreateSpec(); } catch (System.Exception ex) { Application.ShowAlertDialog(ex.Message); } TrayItemBubbleWindow bubble = new TrayItemBubbleWindow(); bubble.IconType = IconType.Warning; bubble.Text = "BubleText"; bubble.Text2 = "BubleText2"; bubble.Title = "BubleTitle"; TrayItem itemTray = new TrayItem(); itemTray.Icon = System.Drawing.SystemIcons.Warning; itemTray.ToolTipText = "ToolTipText"; itemTray.ShowBubbleWindow(bubble); Application.StatusBar.TrayItems.Add(itemTray); Application.StatusBar.Update(); if (Inspector.HasErrors) { Inspector.Show(); } }
private TrayItem GetTrayItem(int i, IntPtr hBuffer, IntPtr hProcess, IntPtr toolbarHwnd) { TBBUTTON tbButton = new TBBUTTON(); TrayItem trayItem = new TrayItem(); IntPtr hTBButton = Marshal.AllocHGlobal(Marshal.SizeOf(tbButton)); IntPtr hTrayItem = Marshal.AllocHGlobal(Marshal.SizeOf(trayItem)); IntPtr msgSuccess = SendMessage(toolbarHwnd, (int)TB.GETBUTTON, (IntPtr)i, hBuffer); if (ReadProcessMemory(hProcess, hBuffer, hTBButton, Marshal.SizeOf(tbButton), out _)) { tbButton = (TBBUTTON)Marshal.PtrToStructure(hTBButton, typeof(TBBUTTON)); if (tbButton.dwData != UIntPtr.Zero) { if (ReadProcessMemory(hProcess, tbButton.dwData, hTrayItem, Marshal.SizeOf(trayItem), out _)) { trayItem = (TrayItem)Marshal.PtrToStructure(hTrayItem, typeof(TrayItem)); if ((tbButton.fsState & TBSTATE_HIDDEN) != 0) { trayItem.dwState = 1; } else { trayItem.dwState = 0; } ShellLogger.Debug( $"ExplorerTrayService: Got tray item: {trayItem.szIconText}"); } } } return(trayItem); }
public bool Valid(TrayItem obj) { throw new NotImplementedException(); }
public static void StatusBarBalloon(string category, string title) { const string appName = "PGA TOUR CivTinSurface Notification"; Document doc = ACADDOC.Application.DocumentManager.MdiActiveDocument; var statusBar = doc.GetStatusBar(); TrayItem ti = new TrayItem(); ti.ToolTipText = appName; ti.Icon = statusBar.TrayItems[0].Icon; statusBar.TrayItems.Add(ti); TrayItemBubbleWindow bw = new TrayItemBubbleWindow(); bw.Title = title; //bw.HyperText = htext; //bw.HyperLink = hlink; bw.Text = title; bw.Text2 = String.Format("Finishing {0}", category); bw.IconType = IconType.Information; ti.ShowBubbleWindow(bw); statusBar.Update(); bw.Closed += delegate( object o, TrayItemBubbleWindowClosedEventArgs args ) { // Use a try-catch block, as an exception // will occur when AutoCAD is closed with // one of our bubbles open try { statusBar.TrayItems.Remove(ti); statusBar.Update(); } catch { } }; }
private static void SetTrayIcon() { // Добавление иконки в трей try { TrayItem ti = new TrayItem(); ti.ToolTipText = "Палитра ПИК"; ti.Icon = Icon.FromHandle(Properties.Resources.logo.GetHicon()); ti.MouseDown += PikTray_MouseDown; ti.Visible = true; Application.StatusBar.TrayItems.Add(ti); //Pane pane = new Pane(); //pane.ToolTipText = "Палитра ПИК"; //pane.Icon = Icon.FromHandle(Properties.Resources.logo.GetHicon()); //pane.MouseDown += PikTray_MouseDown; //Application.StatusBar.Panes.Add(pane); } catch { } }