Added refresh button

This commit is contained in:
Jaex 2021-01-14 00:46:08 +03:00
parent d071a62a0b
commit a9f1f27360
2 changed files with 32 additions and 8 deletions

View file

@ -33,6 +33,7 @@ private void InitializeComponent()
this.pInfo = new System.Windows.Forms.Panel();
this.btnInspectWindow = new System.Windows.Forms.Button();
this.btnInspectControl = new System.Windows.Forms.Button();
this.btnRefresh = new System.Windows.Forms.Button();
this.pInfo.SuspendLayout();
this.SuspendLayout();
//
@ -60,7 +61,7 @@ private void InitializeComponent()
this.pInfo.Name = "pInfo";
this.pInfo.Padding = new System.Windows.Forms.Padding(3);
this.pInfo.Size = new System.Drawing.Size(672, 488);
this.pInfo.TabIndex = 2;
this.pInfo.TabIndex = 3;
//
// btnInspectWindow
//
@ -82,11 +83,22 @@ private void InitializeComponent()
this.btnInspectControl.UseVisualStyleBackColor = true;
this.btnInspectControl.Click += new System.EventHandler(this.btnInspectControl_Click);
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(312, 8);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(144, 24);
this.btnRefresh.TabIndex = 2;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.UseVisualStyleBackColor = true;
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// InspectWindowForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(689, 536);
this.Controls.Add(this.btnRefresh);
this.Controls.Add(this.btnInspectControl);
this.Controls.Add(this.btnInspectWindow);
this.Controls.Add(this.pInfo);
@ -103,5 +115,6 @@ private void InitializeComponent()
private System.Windows.Forms.Panel pInfo;
private System.Windows.Forms.Button btnInspectWindow;
private System.Windows.Forms.Button btnInspectControl;
private System.Windows.Forms.Button btnRefresh;
}
}

View file

@ -69,13 +69,19 @@ private void UpdateWindowInfo()
if (SelectedWindow != null)
{
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());
try
{
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());
}
catch
{
}
}
}
@ -102,5 +108,10 @@ private void btnInspectControl_Click(object sender, EventArgs e)
{
SelectHandle();
}
private void btnRefresh_Click(object sender, EventArgs e)
{
UpdateWindowInfo();
}
}
}