jj
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
Imports DD_Clipboard_Watcher.ClassWindowAPI
|
||||
Imports System.Windows.Automation
|
||||
Imports DD_Clipboard_Watcher.ClassWindowAPI
|
||||
|
||||
Public Class frmControlCapture
|
||||
Public ControlName As String
|
||||
Public ProcessName As String
|
||||
Public AutomationId As String
|
||||
Public FrameworkId As String
|
||||
|
||||
Public Automation As ClassAutomation
|
||||
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
||||
Dim oResult As WindowInfo = GetFocusedControl(Handle)
|
||||
@@ -11,11 +16,36 @@ Public Class frmControlCapture
|
||||
txtPID.Text = oResult.ClassName
|
||||
txtName.Text = oResult.ProcessName
|
||||
txtControlName.Text = oResult.ControlName
|
||||
txtAutomationId.Text = Automation.AutomationId
|
||||
txtFrameworkId.Text = Automation.FrameworkId
|
||||
|
||||
FrameworkId = Automation.FrameworkId
|
||||
AutomationId = Automation.AutomationId
|
||||
ControlName = oResult.ControlName
|
||||
ProcessName = oResult.ProcessName
|
||||
Button1.Enabled = True
|
||||
Else
|
||||
Button1.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmControlCapture_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Automation = New ClassAutomation(LogConfig)
|
||||
End Sub
|
||||
|
||||
Private Sub frmControlCapture_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
Automation.RemoveHandler()
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
If chkAutomationId.Checked = False Then
|
||||
AutomationId = String.Empty
|
||||
End If
|
||||
|
||||
If chkControlName.Checked = False Then
|
||||
ControlName = String.Empty
|
||||
End If
|
||||
|
||||
If chkAutomationId.Checked = False And chkControlName.Checked = False Then
|
||||
MsgBox("Es muss entweder die AutomationId oder der Feldname ausgewählt sein!", MsgBoxStyle.Exclamation, Text)
|
||||
DialogResult = DialogResult.None
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user