This commit is contained in:
Jonathan Jenne
2019-09-19 16:21:13 +02:00
parent 0ec5829275
commit f3a3812993
7 changed files with 85 additions and 11 deletions

View File

@@ -271,6 +271,7 @@ Public Class ClassProfileFilter
Return oProfiles
End Function
Public Function FilterProfilesByFocusedControl(Profiles As List(Of ProfileData), ClipboardContents As String, ControlFocusresult As String) As List(Of ProfileData)
Dim oWindow As Window.WindowInfo
Dim oFocusedControl As Window.WindowInfo

View File

@@ -88,6 +88,13 @@ Partial Public Class frmMain
Dim oMatchingProfiles As List(Of ProfileData)
Dim oWindow As New Window(My.LogConfig)
Dim oWindowInfo = oWindow.GetWindowInfo()
Dim oControls As New Dictionary(Of String, Window.RectangleInfo) From {
{"TOPLEFT", New Window.RectangleInfo() With {.Left = 20, .Top = 43}}
}
Dim oControl = oWindow.GetFocusedControlLocation(Handle, Window.Anchor.TopLeft)
Dim oFocusedControl As Window.WindowInfo = oWindow.GetFocusedControl(Handle)
Dim oClipboardContents As String = Clipboard.GetText()
@@ -106,7 +113,8 @@ Partial Public Class frmMain
Logger.Debug("Profiles after FilterProfilesByProcess: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterWindowsByWindowTitleRegex(oMatchingProfiles, oWindowInfo.WindowTitle)
Logger.Debug("Profiles after FilterWindowsByWindowTitleRegex: {0}", oMatchingProfiles.Count)
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControl(oMatchingProfiles, oClipboardContents, oFocusedControl.hWnd.ToString)
'oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControl(oMatchingProfiles, oClipboardContents, oFocusedControl.hWnd.ToString)
oMatchingProfiles = oProfileFilter.FilterProfilesByFocusedControlLocation(oMatchingProfiles, oClipboardContents)
Logger.Debug("Profiles after FilterProfilesByFocusedControl: {0}", oMatchingProfiles.Count)
oMatchingProfiles = Await Task.Run(Function() oProfileFilter.FilterProfilesBySearchResults(oMatchingProfiles))
Logger.Debug("Profiles after FilterProfilesBySearchResults: {0}", oMatchingProfiles.Count)