fix failure to restore full screen rdp window

This commit is contained in:
Kang Yu 2024-10-20 22:45:04 -07:00
parent cee860c2d4
commit 6cbfea8f69
2 changed files with 65 additions and 29 deletions

View file

@ -1,7 +1,10 @@
using System;
using System.Text;
using System.Xml;
using System.Runtime.Serialization;
using PersistentWindows.Common.WinApiBridge;
using PersistentWindows.Common.Diagnostics;
namespace PersistentWindows.Common.Models
{
@ -55,7 +58,15 @@ namespace PersistentWindows.Common.Models
public override string ToString()
{
//return string.Format("{0}.{1} {2}", ProcessId, HWnd.ToString("X8"), ProcessName);
return string.Format("{0}.{1:x8} {2}", ProcessId, HWnd.ToInt64(), ProcessName);
//return string.Format("process:{0:x4} hwnd:{1:x6} {2}", ProcessId, HWnd.ToInt64(), ProcessName);
DataContractSerializer dcs = new DataContractSerializer(typeof(ApplicationDisplayMetrics));
StringBuilder sb = new StringBuilder();
using (XmlWriter xw = XmlWriter.Create(sb))
{
dcs.WriteObject(xw, this);
}
string xml = sb.ToString();
return xml;
}
}
}