public ConfigForm(ScreenSaver pScreenSaver) { InitializeComponent(); this.Icon = Properties.Resources.Alecive_Flatwoken_Apps_Computer_Screensaver; startupCheckbox.Checked = RegistryHelper.LoadStartup(); screenNameTextbox.Text = RegistryHelper.LoadScreenName(); timeoutTextbox.Text = RegistryHelper.LoadTimeout().ToString(); pollRateTextbox.Text = RegistryHelper.LoadPollRate().ToString(); this.screenSaver = pScreenSaver; }
public MainForm() { InitializeComponent(); RegistryHelper.InitValues(); this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; this.notifyIcon1.Icon = SystemIcons.Application; this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.contextMenu1.MenuItems.AddRange( new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem2, this.menuItem3 }); this.menuItem1.Index = 0; this.menuItem1.Text = "Pause"; this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click); this.menuItem1.Checked = false; this.menuItem2.Index = 1; this.menuItem2.Text = "Config"; this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click); this.menuItem3.Index = 2; this.menuItem3.Text = "Exit"; this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click); this.notifyIcon1.ContextMenu = this.contextMenu1; notifyIcon1.Visible = true; this.notifyIcon1.Icon = new Icon(Properties.Resources.Alecive_Flatwoken_Apps_Computer_Screensaver, 40, 40); Icon = Properties.Resources.Alecive_Flatwoken_Apps_Computer_Screensaver; screenSaver = new ScreenSaver(); screenSaver.RegisterHideFormCallback(HideFormCallback); screenSaver.RegisterShowFormCallback(ShowFormCallback); screenSaver.Launch(); Hide(); }