Bildschirmtastatur
26.06.2018 21:17:37
Phil
habe früher auf meinem Windows 8.1 Tablet mit folgendem Modul die Tastatur immer geöffnet und geschlossen wenn ich ein Textfeld betreten und verlassen haben:
Leider funktioniert es mit Windows 10 nicht mehr, habe hier den Speicherort der TabTip.exe zwar auf C:\Program Files\Common Files\microsoft shared\ink geändert. Aber leider schließt er die Tastatur nicht!
Hat einer Lösung hierfür? Vielen Dank!
anbei der alte Code der unter Windows 8.1 ohne Probleme funktionierte:
Option Explicit
Option Private Module
Private Declare PtrSafe Function GetCurrentProcess Lib "kernel32.dll" () As LongPtr
Private Declare PtrSafe Function IsWow64Process Lib "kernel32.dll" ( _
ByVal hProcess As LongPtr, _
ByRef Wow64Process As LongPtr) As Long
Private Declare PtrSafe Function ShellExecuteA Lib "shell32.dll" ( _
ByVal hWnd As LongPtr, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Declare PtrSafe Function Wow64EnableWow64FsRedirection Lib "kernel32.dll" ( _
ByVal Enable As Boolean) As Boolean
Private Const SW_SHOWNORMAL As Long = 1&
Public Sub LoadScreenKeyboard()
Dim lngptrIsWow64 As LongPtr, lngptrProcess As LongPtr
lngptrProcess = GetCurrentProcess
Call IsWow64Process(lngptrProcess, lngptrIsWow64)
If lngptrIsWow64 = 0 Then
Call ShellExecuteA(Application.hWnd, "open", "TabTip.exe", vbNullString, "C:\Windows\ _
System32\", SW_SHOWNORMAL)
Else
Call Wow64EnableWow64FsRedirection(False)
Call ShellExecuteA(Application.hWnd, "open", "TabTip.exe", vbNullString, "C:\Windows\ _
System32\", SW_SHOWNORMAL)
Call Wow64EnableWow64FsRedirection(True)
End If
End Sub
Public Sub UnloadScreenKeyboard()
Dim objWMI As Object, objProcessList As Object, objProcess As Object
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set objProcessList = objWMI.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'TabTip.exe' _
")
For Each objProcess In objProcessList
Call objProcess.Terminate
Next
Set objProcessList = Nothing
Set objWMI = Nothing
End Sub