Download AppActivationDemo.zip, last updated 29/12/2013 (11.64 KB)

Download
  • md5: 3d84cc965982745d60d01044853821d7
using System;
using System.Diagnostics;
using System.Windows.Forms;

// How to be notified when your application is activated and deactivated
// http://cyotek.com/blog/how-to-be-notified-when-your-application-is-activated-and-deactivated

namespace AppActivationDemo
{
  internal partial class AboutDialog : Form
  {
    #region Constructors

    public AboutDialog()
    {
      InitializeComponent();
    }

    #endregion

    #region Overridden Members

    protected override void OnLoad(EventArgs e)
    {
      FileVersionInfo versionInfo;

      versionInfo = FileVersionInfo.GetVersionInfo(typeof(MainForm).Assembly.Location);
      nameLabel.Text = versionInfo.ProductName;
      copyrightLabel.Text = versionInfo.LegalCopyright;

      base.OnLoad(e);
    }

    #endregion

    #region Event Handlers

    private void closeButton_Click(object sender, EventArgs e)
    {
      this.Close();
    }

    private void webLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
      try
      {
        Process.Start("http://cyotek.com");
      }
      catch (Exception ex)
      {
        MessageBox.Show(ex.GetBaseException().Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
      }
    }

    #endregion
  }
}

Donate

Donate