Added more window info

This commit is contained in:
Jaex 2021-01-13 23:08:44 +03:00
parent 8a0a8bce9d
commit 2ca4f0ccb8
2 changed files with 21 additions and 13 deletions

View file

@ -39,10 +39,11 @@ private void InitializeComponent()
this.rtbInfo.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.rtbInfo.DetectUrls = false;
this.rtbInfo.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtbInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtbInfo.Location = new System.Drawing.Point(2, 2);
this.rtbInfo.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtbInfo.Location = new System.Drawing.Point(3, 3);
this.rtbInfo.Name = "rtbInfo";
this.rtbInfo.Size = new System.Drawing.Size(666, 514);
this.rtbInfo.ReadOnly = true;
this.rtbInfo.Size = new System.Drawing.Size(664, 512);
this.rtbInfo.TabIndex = 0;
this.rtbInfo.Text = "";
//
@ -55,7 +56,7 @@ private void InitializeComponent()
this.pInfo.Controls.Add(this.rtbInfo);
this.pInfo.Location = new System.Drawing.Point(8, 8);
this.pInfo.Name = "pInfo";
this.pInfo.Padding = new System.Windows.Forms.Padding(2);
this.pInfo.Padding = new System.Windows.Forms.Padding(3);
this.pInfo.Size = new System.Drawing.Size(672, 520);
this.pInfo.TabIndex = 1;
//

View file

@ -76,16 +76,23 @@ private void UpdateWindowInfo()
if (SelectedWindow != null)
{
rtbInfo.SetFontBold();
rtbInfo.AppendText("Handle: ");
rtbInfo.SetFontRegular();
rtbInfo.AppendLine(SelectedWindow.Handle.ToString("X8"));
rtbInfo.SetFontBold();
rtbInfo.AppendText("Title: ");
rtbInfo.SetFontRegular();
rtbInfo.AppendLine(SelectedWindow.Text);
AddInfo("Window handle", SelectedWindow.Handle.ToString("X8"));
AddInfo("Window title", SelectedWindow.Text);
AddInfo("Class name", SelectedWindow.ClassName);
AddInfo("Process name", SelectedWindow.ProcessName);
AddInfo("Window rectangle", SelectedWindow.Rectangle.ToString());
AddInfo("Client rectangle", SelectedWindow.ClientRectangle.ToString());
AddInfo("Window styles", SelectedWindow.Styles.ToString());
}
}
private void AddInfo(string name, string value)
{
rtbInfo.SetFontBold();
rtbInfo.AppendLine(name + ":");
rtbInfo.SetFontRegular();
rtbInfo.AppendLine(value);
rtbInfo.AppendLine();
}
}
}