private void FormMain_Load(object sender, EventArgs e) { try { if (System.IO.File.Exists(Application.ExecutablePath + ".ico")) { this.Icon = new System.Drawing.Icon(Application.ExecutablePath + ".ico"); } } catch (System.Exception ex) { LogFile.Warn("Exception while setting icon: " + ex.ToString()); } if (Program.IsProtected) { WndProtect.Init(); } }