Ejemplo n.º 1
0
        private void btnOpenExplorerOnLogonImageLocation_Click(object sender, EventArgs e)
        {
            string imageBaseFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
            string imageFolder     = imageBaseFolder + @"\PhotoDesktop";
            string fullfilename    = imageBaseFolder + @"\PhotoDesktop" + @"\PhotoDesktopLogongImage.png";
            // check if folder exists
            bool exists = System.IO.Directory.Exists(imageFolder);

            if (!exists)
            {
                System.IO.Directory.CreateDirectory(imageFolder);
            }
            // create folder

            Screen[] screens = Screen.AllScreens;
            Screen   screen  = screens[0];

            DesktopImage logonImage = new DesktopImage(_photoDesktop.ImageList.Next(screen.DeviceName));

            Wallpaper.CreateLogonScreenImage(logonImage, fullfilename);


            StartProcess(imageFolder);
            // https://winaero.com/blog/file-explorer-command-line-arguments-in-windows-10/
            // explorer.exe /select,"C:\apps\firefox beta\firefox.exe"
            // explorer.exe /e,folder_path
        }