Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Create a system tray icon and a dialog for a Windows Service

, 25 Jan 2008 CPOL
This article shows how to create a system tray icon and a dialog for a Windows Service.
bin.zip
Interop.SensEvents.dll
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.vshost.exe
Interop.COMAdmin.dll
binary.zip
Interop.SensEvents.dll
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.vshost.exe
Interop.COMAdmin.dll
source.zip
SystemTrayIconInSvc.csproj.user
SystemTrayIconInSvc.suo
obj
Debug
Interop.COMAdmin.dll
Interop.SensEvents.dll
Refactor
SystemTrayIconInSvc.csproj.GenerateResource.Cache
SystemTrayIconInSvc.csproj.ResolveComReference.cache
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.pdb
SystemTrayIconInSvc.SettingDlg.resources
TempPE
Release
Interop.COMAdmin.dll
Interop.SensEvents.dll
SystemTrayIconInSvc.csproj.GenerateResource.Cache
SystemTrayIconInSvc.csproj.ResolveComReference.cache
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.pdb
SystemTrayIconInSvc.SettingDlg.resources
TempPE
Properties
SourceAndBinary.zip
SystemTrayIconInSvc.csproj.user
bin
Release
Interop.COMAdmin.dll
Interop.SensEvents.dll
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.vshost.exe
sourcecode.zip
SystemTrayIconInSvc.csproj.user
SystemTrayIconInSvc.suo
Interop.COMAdmin.dll
Interop.SensEvents.dll
SystemTrayIconInSvc.csproj.GenerateResource.Cache
SystemTrayIconInSvc.csproj.ResolveComReference.cache
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.pdb
SystemTrayIconInSvc.SettingDlg.resources
Interop.COMAdmin.dll
Interop.SensEvents.dll
SystemTrayIconInSvc.csproj.GenerateResource.Cache
SystemTrayIconInSvc.csproj.ResolveComReference.cache
SystemTrayIconInSvc.exe
SystemTrayIconInSvc.pdb
SystemTrayIconInSvc.SettingDlg.resources
namespace SystemTrayIconInSvc
{
    partial class SettingDlg
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.ctlNotifyIcon = new System.Windows.Forms.NotifyIcon(this.components);
            this.btnHide = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // ctlNotifyIcon
            // 
            this.ctlNotifyIcon.Text = "ctlNotifyIcon";
            this.ctlNotifyIcon.Visible = true;
            // 
            // btnHide
            // 
            this.btnHide.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnHide.Location = new System.Drawing.Point(263, 84);
            this.btnHide.Name = "btnHide";
            this.btnHide.Size = new System.Drawing.Size(70, 23);
            this.btnHide.TabIndex = 0;
            this.btnHide.Text = "&OK";
            this.btnHide.UseVisualStyleBackColor = true;
            this.btnHide.Click += new System.EventHandler(this.btnHide_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(321, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "This is the dialog which is also implemented in the windows service";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(12, 47);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(203, 26);
            this.label2.TabIndex = 2;
            this.label2.Text = "You can re-login / restart windows to see \r\nwhether it appears after you login ";
            // 
            // SettingDlg
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(357, 188);
            this.ControlBox = false;
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.btnHide);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "SettingDlg";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Setting";
            this.Load += new System.EventHandler(this.SettingDlg_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.NotifyIcon ctlNotifyIcon;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Jerry.Wang
Team Leader
China China
Jerry is from China. He was captivated by computer programming since 13 years old when first time played with Q-Basic.
 

  • Windows / Linux & C++
  • iOS & Obj-C
  • .Net & C#
  • Flex/Flash & ActionScript
  • HTML / CSS / Javascript
  • Gaming Server programming / video, audio processing / image & graphics
 
Contact: vcer(at)qq.com
Chinese Blog: http://blog.csdn.net/wangjia184

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141220.1 | Last Updated 25 Jan 2008
Article Copyright 2008 by Jerry.Wang
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid