Ejemplo n.º 1
0
        public Desktop(string name, IntPtr normalDesktop, Graphics graphics)
        {
            Name               = name;
            this.graphics      = graphics;
            this.normalDesktop = normalDesktop;

            DesktopHelper = new DesktopHelper();

            try
            {
                Dir = new DirectoryInfo(
                    Path.Combine(ConfigurationManager.AppSettings.GetValues("savepath").First(),
                                 Name, Name));
            }
            catch (Exception)
            {
                Dir = new DirectoryInfo($@"D:\Desktops\{Name}\{Name}");
            }

            HandleDesktop = createNewDesktop();  //TODO: Problem

            if (!File.Exists(Dir.Parent.FullName + "\\options.dt"))
            {
                Dir.Create();
                Save();
            }
            else
            {
                DesktopSerializer.DeSerializer(this);
            }

            User32.OpenDesktop(Name, 0x0001, false, (long)DesktopAcessMask.GENERIC_ALL);
        }
Ejemplo n.º 2
0
 public void Save() => DesktopSerializer.Serialize(this);