VersionRelease

This commit is contained in:
Digital Data - Marlon Schreiber
2019-08-26 11:41:24 +02:00
parent a4086de11b
commit c7731cbb6d
35 changed files with 8126 additions and 4491 deletions

View File

@@ -3,6 +3,8 @@ Imports System.IO
Imports System.Globalization
Imports DD_LIB_Standards
Imports DD_Clipboard_Watcher.ClassConstants
Imports System.Windows.Automation
Imports DD_Clipboard_Watcher.ClassWindowAPI
Public Class frmStart
Dim WithEvents Hotkey As New ClassHotkey(Me)
@@ -56,7 +58,6 @@ Public Class frmStart
End If
labelUser.Text = String.Format(labelUser.Text, USER_USERNAME)
labelVersion.Text = String.Format(labelVersion.Text, My.Application.Info.Version.ToString)
labelHotkey.Text = String.Format(labelHotkey.Text, $"{HotkeyFunctionKey.ToUpper}+{HotkeySearchKey.ToUpper}")
End Sub
@@ -109,33 +110,61 @@ Public Class frmStart
Dim oWindowInfo = ClassWindowAPI.GetWindowInfo()
Dim ClipboardContents As String = Clipboard.GetText()
Dim oProfileFilter As ClassProfileFilter
Dim newoResult As IntPtr = FocusedControlinActiveWindow(Handle)
Try
oProfileFilter = New ClassProfileFilter(DT_USER_PROFILES, DTPROFILE_REL_WINDOW, DTPROFILE_REL_CONTROL)
oProfileFilter = New ClassProfileFilter(DT_USER_PROFILES, DTPROFILE_REL_PROCESS, DTPROFILE_REL_WINDOW, DTPROFILE_REL_CONTROL)
Catch ex As Exception
MsgBox("Fehler beim Laden der Profile. Möglicherweise liegt ein Konfigurationsfehler vor.", MsgBoxStyle.Critical, Text)
Exit Sub
End Try
Dim oProfiles = oProfileFilter.Profiles.AsEnumerable()
CurrMatchTreeView.Nodes.Clear()
CurrMatchTreeView.ImageList = ImageList1
CurrMatchTreeView.SelectedImageIndex = 0
oProfiles = oProfileFilter.FilterProfilesByProcess(oProfiles, oWindowInfo.ProcessName)
oProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oProfiles, oWindowInfo.WindowTitle)
oProfiles = oProfileFilter.FilterWindowsByWindowClipboardRegex(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles, ClipboardContents)
oProfiles = oProfileFilter.RemoveDuplicateProfiles()
If oProfiles.Count > 0 Then
oProfiles = oProfileFilter.FilterProfilesByProcess(oProfiles, oWindowInfo.ProcessName)
If oProfiles.Count > 0 Then
oProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oProfiles, oWindowInfo.WindowTitle)
If oProfiles.Count > 0 Then
' Dim ControlFocusResult
Dim oResult As WindowInfo = GetFocusedControl(Handle)
'Automation = New ClassAutomation(LogConfig)
'If Not IsNothing(Automation.AutomationId) Then
' ControlFocusResult = Automation.AutomationId
'Else
' ControlFocusResult = String.Empty
'End If
' MsgBox(newoResult.ToString)
oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles, ClipboardContents, newoResult.ToString)
'oProfiles = oProfileFilter.FilterWindowsByWindowClipboardRegex(oProfiles, ClipboardContents)
End If
End If
End If
'oProfiles = oProfileFilter.RemoveDuplicateProfiles()
oProfiles = oProfileFilter.ClearNotMatchedProfiles(oProfiles)
oProfiles = oProfiles.ToList()
CURRENT_MATCHING_PROFILES = oProfiles
CURRENT_CLIPBOARD_CONTENTS = ClipboardContents
CURRENT_CLIPBOARD_CONTENTS = ClipboardContents
End Sub
Private Sub ReceiveHotKey(ByVal HotKeyID As String) Handles Hotkey.HotKeyPressed
If HotKeyID = HOTKEY_TRIGGER_WATCHER Then
If CURRENT_MATCHING_PROFILES.Count > 0 And MONITORING_ACTIVE = True Then
CHECK_PROFILE_MATCH()
If CURRENT_CLIPBOARD_CONTENTS IsNot Nothing Then
If CURRENT_MATCHING_PROFILES.Count > 0 And MONITORING_ACTIVE = True Then
CHECK_PROFILE_MATCH()
End If
End If
ElseIf HotKeyID = HOTKEY_TOGGLE_WATCHER Then
Change_Monitoring_State()
End If
@@ -227,6 +256,7 @@ Public Class frmStart
If USER_IS_ADMIN = True Then
btnAdminConfig.Visible = True
End If
TimerRefresh.Start()
End Sub
Private Sub NotifyIcon1_DoubleClick(sender As Object, e As EventArgs) Handles NotifyIconMain.DoubleClick
@@ -296,8 +326,18 @@ Public Class frmStart
End Sub
Private Sub ClientBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ClientBeendenToolStripMenuItem.Click
Shut_Down
End Sub
Sub Shut_Down()
If MsgBox("Wollen Sie das Programm beenden?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) = MsgBoxResult.Yes Then
Close()
End If
End Sub
Private Sub TimerRefresh_Tick(sender As Object, e As EventArgs) Handles TimerRefresh.Tick
ClassInit.Refresh_Profile_Links()
lblrefresh.Text =
ClassInit.CheckModuleData()
lblrefresh.Text = $"Refreshed: {Now.ToShortTimeString} - UserLoggedIn: {USERCOUNT_LOGGED_IN}"
End Sub
End Class