VersionRelease
This commit is contained in:
@@ -231,4 +231,18 @@ Public Class ClassWindowAPI
|
||||
End Try
|
||||
|
||||
End Function
|
||||
Public Shared Function FocusedControlinActiveWindow(WindowHandle As IntPtr) As IntPtr
|
||||
Try
|
||||
Dim activewindowhandle As IntPtr = GetForegroundWindow
|
||||
Dim activewindowThread As IntPtr = GetWindowThreadProcessId(activewindowhandle, IntPtr.Zero)
|
||||
Dim thiswindowthread As IntPtr = GetWindowThreadProcessId(WindowHandle, IntPtr.Zero)
|
||||
AttachThreadInput(activewindowThread, thiswindowthread, True)
|
||||
Dim focusedControlHandle As IntPtr = GetFocus()
|
||||
AttachThreadInput(activewindowThread, thiswindowthread, False)
|
||||
Return focusedControlHandle
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user