I have just tried the following and it works fine;
Public Class Form1
Private OSK As System.Diagnostics.Process
Private Sub ButtonShowOSK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonShowOSK.Click
OSK = System.Diagnostics.Process.Start("osk.exe")
End Sub
Private Sub ButtonKillOSK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonKillOSK.Click
Try
OSK.Kill()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
End Class
Note1: the OSK process has a
CloseMainWindow()
method, however, it returns
true,
indicating success, but the OSK remains running.
Note2: the OSK process has a
Close()
method, but nothing hapens.
So, the KILL method works!