more tweaks
This commit is contained in:
@@ -5,6 +5,21 @@ Public Class frmProcessCapture
|
||||
Public ProcessName As String
|
||||
Public WindowTitle As String
|
||||
|
||||
Private _CurrentProcess As String = String.Empty
|
||||
|
||||
Public Sub New()
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
|
||||
Public Sub New(CurrentProcess As String)
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
_CurrentProcess = CurrentProcess
|
||||
End Sub
|
||||
|
||||
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
|
||||
Dim oWindow = ClassWindowAPI.GetWindowInfo()
|
||||
|
||||
@@ -13,16 +28,22 @@ Public Class frmProcessCapture
|
||||
End If
|
||||
|
||||
Dim oProgramName As String = Assembly.GetEntryAssembly().GetName().Name
|
||||
Dim oIsClipboardWatcherWindow = oWindow.ProcessName <> oProgramName
|
||||
Dim oIsCorrectProcessName = IIf(_CurrentProcess = String.Empty, True, oWindow.ProcessName = _CurrentProcess)
|
||||
|
||||
If oWindow.ProcessName <> oProgramName Then
|
||||
txtPID.Text = oWindow.ProcessId
|
||||
txtName.Text = oWindow.ProcessName
|
||||
txtWindowTitle.Text = oWindow.WindowTitle
|
||||
ProcessId = oWindow.ProcessId
|
||||
ProcessName = oWindow.ProcessName
|
||||
WindowTitle = oWindow.WindowTitle
|
||||
txtPID.Text = oWindow.ProcessId
|
||||
txtName.Text = oWindow.ProcessName
|
||||
txtWindowTitle.Text = oWindow.WindowTitle
|
||||
ProcessId = oWindow.ProcessId
|
||||
ProcessName = oWindow.ProcessName
|
||||
WindowTitle = oWindow.WindowTitle
|
||||
|
||||
If oIsClipboardWatcherWindow And oIsCorrectProcessName Then
|
||||
Button1.Enabled = True
|
||||
txtName.BackColor = SystemColors.Control
|
||||
Else
|
||||
Button1.Enabled = False
|
||||
txtName.BackColor = Color.LightSalmon
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user