MistakesWereMade
Board Regular
- Joined
- May 22, 2019
- Messages
- 103
I got osk.exe to open but would rather utilize TabTip.exe instead. Any ideas on how this may be achieved? My code for bringing up the osk.exe is shown below.
Code:
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpszOp As String, ByVal lpszFile As String, ByVal lpszParams As String, ByVal LpszDir As String, ByVal FsShowCmd As Long) As Long
Private Declare PtrSafe Function Wow64EnableWow64FsRedirection Lib "kernel32.dll" (ByVal Enable As Boolean) As Boolean
Private Declare PtrSafe Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare PtrSafe Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare PtrSafe Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare PtrSafe Function IsWow64Process Lib "kernel32" (ByVal hProc As Long, bWow64Process As Long) As Long
Public Function Is64bit() As Long
If GetProcAddress(GetModuleHandle("kernel32"), "IsWow64Process") > 0 Then
IsWow64Process GetCurrentProcess(), Is64bit
End If
End Function
Private Sub Label1_Click()
ComboBox1.SetFocus
If Is64bit Then
Wow64EnableWow64FsRedirection False
ShellExecute 0, "open", "osk.exe", "", "", vbNormalFocus
Wow64EnableWow64FsRedirection True
Else
ShellExecute 0, "open", "osk.exe", "", "", vbNormalFocus
End If
End Sub