private void saveBtn_Click(object sender, EventArgs e) { _settings.Save(); RegistryKey rk = Registry.CurrentUser.OpenSubKey ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (_settings.Startup) { rk?.SetValue(AppName, Application.ExecutablePath); } else { rk?.DeleteValue(AppName, false); } Wallpaper.SetSlideShow(_settings, Wallpaper.GetResolution()); }
static void Main() { //string path = Directory.GetCurrentDirectory(); //DateTime dt = DateTime.Now; //File.AppendAllText("C:\\Users\\Jim\\jbcstart.txt", "[" + dt + "] Started from : " + path + Environment.NewLine); string appPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) ?? throw new InvalidOperationException()).LocalPath; Directory.SetCurrentDirectory(appPath); AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += MyHandler; SystemEvents.DisplaySettingsChanged += Wallpaper.SystemEvents_DisplaySettingsChanged; Wallpaper.SystemEvents_DisplaySettingsChanged(null, EventArgs.Empty); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form()); }
private void refreshScreens_Click(object sender, EventArgs e) { Wallpaper.SystemEvents_DisplaySettingsChanged(this, new EventArgs()); }
private void nextWallPaper_Click(object sender, EventArgs e) { Wallpaper.NextWallpaper(); }