<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FSystem_Tray_Icon</id>
		<title>Csharp/C Sharp/GUI Windows Form/System Tray Icon - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FSystem_Tray_Icon"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/System_Tray_Icon&amp;action=history"/>
		<updated>2026-04-30T01:31:43Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/System_Tray_Icon&amp;diff=102&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/System_Tray_Icon&amp;diff=102&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/System_Tray_Icon&amp;diff=103&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/System_Tray_Icon&amp;diff=103&amp;oldid=prev"/>
				<updated>2010-05-26T11:33:06Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==System Tray App==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
User Interfaces in C#: Windows Forms and Custom Controls&lt;br /&gt;
by Matthew MacDonald&lt;br /&gt;
Publisher: Apress&lt;br /&gt;
ISBN: 1590590457&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
namespace SystemTrayApp&lt;br /&gt;
{&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;&lt;br /&gt;
  /// Summary description for SystemTrayApp.&lt;br /&gt;
  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
  public class SystemTrayApp : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    internal System.Windows.Forms.Label Label1;&lt;br /&gt;
    internal System.Windows.Forms.Button cmdClose;&lt;br /&gt;
    internal System.Windows.Forms.ListBox lstFiles;&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required designer variable.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private System.ruponentModel.Container components = null;&lt;br /&gt;
    public SystemTrayApp()&lt;br /&gt;
    {&lt;br /&gt;
      //&lt;br /&gt;
      // Required for Windows Form Designer support&lt;br /&gt;
      //&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      //&lt;br /&gt;
      // TODO: Add any constructor code after InitializeComponent call&lt;br /&gt;
      //&lt;br /&gt;
    }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Clean up any resources being used.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    protected override void Dispose( bool disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if( disposing )&lt;br /&gt;
      {&lt;br /&gt;
        if(components != null)&lt;br /&gt;
        {&lt;br /&gt;
          components.Dispose();&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      base.Dispose( disposing );&lt;br /&gt;
    }&lt;br /&gt;
    #region Windows Form Designer generated code&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required method for Designer support - do not modify&lt;br /&gt;
    /// the contents of this method with the code editor.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.Label1 = new System.Windows.Forms.Label();&lt;br /&gt;
      this.cmdClose = new System.Windows.Forms.Button();&lt;br /&gt;
      this.lstFiles = new System.Windows.Forms.ListBox();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // Label1&lt;br /&gt;
      // &lt;br /&gt;
      this.Label1.Location = new System.Drawing.Point(10, 7);&lt;br /&gt;
      this.Label1.Name = &amp;quot;Label1&amp;quot;;&lt;br /&gt;
      this.Label1.Size = new System.Drawing.Size(140, 16);&lt;br /&gt;
      this.Label1.TabIndex = 5;&lt;br /&gt;
      this.Label1.Text = &amp;quot;Recently created files:&amp;quot;;&lt;br /&gt;
      // &lt;br /&gt;
      // cmdClose&lt;br /&gt;
      // &lt;br /&gt;
      this.cmdClose.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | &lt;br /&gt;
                      System.Windows.Forms.AnchorStyles.Right);&lt;br /&gt;
      this.cmdClose.FlatStyle = System.Windows.Forms.FlatStyle.System;&lt;br /&gt;
      this.cmdClose.Location = new System.Drawing.Point(162, 203);&lt;br /&gt;
      this.cmdClose.Name = &amp;quot;cmdClose&amp;quot;;&lt;br /&gt;
      this.cmdClose.Size = new System.Drawing.Size(88, 24);&lt;br /&gt;
      this.cmdClose.TabIndex = 4;&lt;br /&gt;
      this.cmdClose.Text = &amp;quot;Close&amp;quot;;&lt;br /&gt;
      this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click);&lt;br /&gt;
      // &lt;br /&gt;
      // lstFiles&lt;br /&gt;
      // &lt;br /&gt;
      this.lstFiles.Anchor = (((System.Windows.Forms.AnchorStyles.Top | &lt;br /&gt;
                         System.Windows.Forms.AnchorStyles.Bottom) &lt;br /&gt;
        | System.Windows.Forms.AnchorStyles.Left) &lt;br /&gt;
        | System.Windows.Forms.AnchorStyles.Right);&lt;br /&gt;
      this.lstFiles.IntegralHeight = false;&lt;br /&gt;
      this.lstFiles.Location = new System.Drawing.Point(10, 27);&lt;br /&gt;
      this.lstFiles.Name = &amp;quot;lstFiles&amp;quot;;&lt;br /&gt;
      this.lstFiles.Size = new System.Drawing.Size(240, 168);&lt;br /&gt;
      this.lstFiles.TabIndex = 3;&lt;br /&gt;
      // &lt;br /&gt;
      // SystemTrayApp&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(260, 234);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                this.Label1,&lt;br /&gt;
                 this.cmdClose,&lt;br /&gt;
                  this.lstFiles});&lt;br /&gt;
      this.Font = new System.Drawing.Font(&amp;quot;Tahoma&amp;quot;, 8.25F, &lt;br /&gt;
                         System.Drawing.FontStyle.Regular, &lt;br /&gt;
                         System.Drawing.GraphicsUnit.Point, &lt;br /&gt;
                         ((System.Byte)(0)));&lt;br /&gt;
      this.Name = &amp;quot;SystemTrayApp&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;SystemTrayApp&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    #endregion&lt;br /&gt;
    private void cmdClose_Click(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      this.Close();&lt;br /&gt;
    }&lt;br /&gt;
    public void FillList(ArrayList list)&lt;br /&gt;
    {&lt;br /&gt;
      lstFiles.DataSource = list;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
//====================================================================&lt;br /&gt;
//====================================================================&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.IO;&lt;br /&gt;
&lt;br /&gt;
namespace SystemTrayApp&lt;br /&gt;
{&lt;br /&gt;
  public class App&lt;br /&gt;
  {&lt;br /&gt;
    // Define the system tray icon control.&lt;br /&gt;
    private NotifyIcon appIcon = new NotifyIcon();&lt;br /&gt;
    // Define the menu.&lt;br /&gt;
    private ContextMenu sysTrayMenu = new ContextMenu();&lt;br /&gt;
    private MenuItem displayFiles = new MenuItem(&amp;quot;Display New Files&amp;quot;);&lt;br /&gt;
    private MenuItem exitApp = new MenuItem(&amp;quot;Exit&amp;quot;);&lt;br /&gt;
    // Define the file system watcher, and a list to store filenames.&lt;br /&gt;
    private FileSystemWatcher watch = new FileSystemWatcher();&lt;br /&gt;
    private ArrayList newFiles = new ArrayList();&lt;br /&gt;
    public void Start()&lt;br /&gt;
    {&lt;br /&gt;
      // Configure the system tray icon.&lt;br /&gt;
      Icon ico = new Icon(&amp;quot;icon.ico&amp;quot;);&lt;br /&gt;
      appIcon.Icon = ico;&lt;br /&gt;
      appIcon.Text = &amp;quot;My .NET Application&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
       // Place the menu items in the menu.&lt;br /&gt;
       sysTrayMenu.MenuItems.Add(displayFiles);&lt;br /&gt;
      sysTrayMenu.MenuItems.Add(exitApp);&lt;br /&gt;
      appIcon.ContextMenu = sysTrayMenu;&lt;br /&gt;
      // Show the system tray icon.&lt;br /&gt;
      appIcon.Visible = true;&lt;br /&gt;
      // Hook up the file watcher.&lt;br /&gt;
      watch.Path = &amp;quot;c:\\&amp;quot;;&lt;br /&gt;
      watch.IncludeSubdirectories = true;&lt;br /&gt;
      watch.EnableRaisingEvents = true;&lt;br /&gt;
      // Attach event handlers.&lt;br /&gt;
      watch.Created += new FileSystemEventHandler(FileCreated);&lt;br /&gt;
      displayFiles.Click += new EventHandler(DisplayFiles);&lt;br /&gt;
      exitApp.Click += new EventHandler(ExitApp);&lt;br /&gt;
    }&lt;br /&gt;
    private void FileCreated(object sender, System.IO.FileSystemEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      newFiles.Add(e.Name);&lt;br /&gt;
    }&lt;br /&gt;
    private void ExitApp(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Application.Exit();&lt;br /&gt;
    }&lt;br /&gt;
    private void DisplayFiles(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      FileList frmFileList = new FileList();&lt;br /&gt;
      frmFileList.FillList(newFiles);&lt;br /&gt;
      frmFileList.Show();&lt;br /&gt;
    }&lt;br /&gt;
    public static void Main()&lt;br /&gt;
    {&lt;br /&gt;
      App app = new App();&lt;br /&gt;
      app.Start();&lt;br /&gt;
      // Because no forms are being displayed, you need this &lt;br /&gt;
      // statement to stop the application from automatically ending.&lt;br /&gt;
      Application.Run();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.nfex.ru/Code/CSharpDownload/SystemTrayApp.zip&amp;quot;&amp;gt;SystemTrayApp.zip( 26 k)&amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>