Compare commits
3 Commits
1f280b73a6
...
87288c3488
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87288c3488 | ||
|
|
7c63f0d111 | ||
|
|
c80c5aea78 |
@@ -205,7 +205,7 @@ Public Class ProfileFilter
|
|||||||
Return oProfiles
|
Return oProfiles
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function FilterProfilesByFocusedControlLocation(Profiles As List(Of ProfileData), ClipboardContents As String, WindowHandle As IntPtr) As List(Of ProfileData)
|
Public Function FilterProfilesByFocusedControl(Profiles As List(Of ProfileData), ClipboardContents As String, WindowHandle As IntPtr) As List(Of ProfileData)
|
||||||
Dim oFilteredProfiles As New List(Of ProfileData)
|
Dim oFilteredProfiles As New List(Of ProfileData)
|
||||||
Dim oWindow As New Window(_LogConfig)
|
Dim oWindow As New Window(_LogConfig)
|
||||||
|
|
||||||
@@ -221,6 +221,18 @@ Public Class ProfileFilter
|
|||||||
For Each oControl In oProfile.Controls
|
For Each oControl In oProfile.Controls
|
||||||
Dim oFound As Boolean = False
|
Dim oFound As Boolean = False
|
||||||
|
|
||||||
|
' If current control does not belong to the current process, skip it
|
||||||
|
Try
|
||||||
|
Dim oFocusedWindow As Window.WindowInfo = oWindow.GetWindowInfo()
|
||||||
|
|
||||||
|
If oFocusedWindow.ProcessName <> oControl.ProcessName Then
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
' If control name is empty, use coordinates
|
||||||
If oControl.ControlName Is Nothing OrElse oControl.ControlName = String.Empty Then
|
If oControl.ControlName Is Nothing OrElse oControl.ControlName = String.Empty Then
|
||||||
Dim oControlBounds As Dictionary(Of String, Window.RectangleInfo)
|
Dim oControlBounds As Dictionary(Of String, Window.RectangleInfo)
|
||||||
|
|
||||||
@@ -471,6 +483,7 @@ Public Class ProfileFilter
|
|||||||
If oRow.Item("PROFILE_ID") = ProfileId Then
|
If oRow.Item("PROFILE_ID") = ProfileId Then
|
||||||
oControlList.Add(New ControlData() With {
|
oControlList.Add(New ControlData() With {
|
||||||
.Guid = oRow.Item("GUID"),
|
.Guid = oRow.Item("GUID"),
|
||||||
|
.ProcessName = NotNull(oRow.Item("PROCESS_NAME"), String.Empty),
|
||||||
.ControlName = NotNull(oRow.Item("CONTROL_NAME"), String.Empty),
|
.ControlName = NotNull(oRow.Item("CONTROL_NAME"), String.Empty),
|
||||||
.Description = NotNull(oRow.Item("DESCRIPTION"), String.Empty),
|
.Description = NotNull(oRow.Item("DESCRIPTION"), String.Empty),
|
||||||
.WindowId = oRow.Item("WINDOW_ID"),
|
.WindowId = oRow.Item("WINDOW_ID"),
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ Partial Public Class frmAdmin
|
|||||||
oMatchingProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oMatchingProfiles, oClipboardContents)
|
oMatchingProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oMatchingProfiles, oClipboardContents)
|
||||||
oMatchingProfiles = oProfileFilter.FilterProfilesByProcess(oMatchingProfiles, oWindowInfo.ProcessName)
|
oMatchingProfiles = oProfileFilter.FilterProfilesByProcess(oMatchingProfiles, oWindowInfo.ProcessName)
|
||||||
oMatchingProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oMatchingProfiles, oWindowInfo.WindowTitle)
|
oMatchingProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oMatchingProfiles, oWindowInfo.WindowTitle)
|
||||||
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oMatchingProfiles, oClipboardContents, Handle)
|
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControl(oMatchingProfiles, oClipboardContents, Handle)
|
||||||
oMatchingProfiles = Await Task.Run(Function()
|
oMatchingProfiles = Await Task.Run(Function()
|
||||||
Return oProfileFilter.FilterProfilesBySearchResults(
|
Return oProfileFilter.FilterProfilesBySearchResults(
|
||||||
oMatchingProfiles,
|
oMatchingProfiles,
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
Public Regex As String
|
Public Regex As String
|
||||||
Public AutomationId As String
|
Public AutomationId As String
|
||||||
Public ControlName As String
|
Public ControlName As String
|
||||||
|
Public ProcessName As String
|
||||||
Public IsMatched As Boolean = False
|
Public IsMatched As Boolean = False
|
||||||
Public TopLeft As ControlBounds
|
Public TopLeft As ControlBounds
|
||||||
Public TopRight As ControlBounds
|
Public TopRight As ControlBounds
|
||||||
|
|||||||
Reference in New Issue
Block a user