The following example demonstrates using the NotifyIcon class to display an icon for an application in the notification area. The example demonstrates setting the Icon, Text and Visible properties and handling the DoubleClick event.

Break On $System = CreateObject("Kixtart.System") $Form = $System.Form() $Form.Text = "NotifyIcon Example" $Form.OnResize = "OnResize()" $Form.Icon = $System.BuiltinIcons(0) $Form.FileMenu = $Form.Menu.MenuItems.Add("File") $Form.ExitMenu = $Form.FileMenu.MenuItems.Add("Exit","OnExit()") $Form.NotifyIcon = $System.NotifyIcon() $Form.NotifyIcon.Icon = $Form.Icon $Form.NotifyIcon.Text = $Form.Text $Form.NotifyIcon.Visible = True $Form.NotifyIcon.OnDoubleClick = "OnDoubleClick()" $Form.Running = 1 While $Form.Running $= Execute($Form.DoEvents) Loop Exit 1 Function OnDoubleClick() If Not $Form.Visible Or $Form.WindowState = $System.FormWindowState.Minimized $Form.WindowState = $System.FormWindowState.Normal $Form.Show() $Form.Activate() Endif EndFunction Function OnResize() If $Form.WindowState = $System.FormWindowState.Minimized $Form.Hide() Endif EndFunction Function OnExit() $Form.Running = 0 EndFunction




The CHM file was converted to HTML by chm2web software.