public static void SetDesktopWinStaAccess() { using (var wsHandle = new WindowStationHandle("WinSta0", (WindowStationAccess)StandardRights.WriteDac)) wsHandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor()); using (var dhandle = new DesktopHandle("Default", false, (DesktopAccess)StandardRights.WriteDac | DesktopAccess.ReadObjects | DesktopAccess.WriteObjects)) dhandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor()); }
public IDesktop GetFromCurrentThread() { var handle = DesktopHandle.GetFromCurrentThread(); return(new Desktop(handle)); }
public IDesktop Open(string name, DesktopOpenFlags flags, bool inherit, DesktopAccessRights desiredAccess) { var handle = DesktopHandle.Open(name, flags, inherit, desiredAccess); return(new Desktop(handle)); }
public Desktop(DesktopHandle handle) { _handle = handle; }