public override string ToString() { return(string.Format("{0}/{1}/{2}/{3}", WindowStationHandle.ToString(), WindowDesktopHandle.ToString(), WindowHandle.ToString(), base.ToString())); }
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()); }