i use vb.net 2012 on Windows 7.0 64 bits pc.
If I try to kill osk.exe is get this error:
System.InvalidOperationException: Cannot process request because the process has exited.
at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
at System.Diagnostics.Process.Kill()

Private OSKProces As System.Diagnostics.Process
If ProcessesRunning("OSK") Then
      OSKProces.Kill()
Else
      OSKProces = System.Diagnostics.Process.Start("osk.exe")
End If

I also tried the following:
OSKProces.CloseMainWindow()
OSKProces.Close()

But with no error but OSK stay's active, and visible !

I anybody help me please

start osk.exe process

Dim OSKProces As System.Diagnostics.Process
OSKProces = System.Diagnostics.Process.Start("osk.exe")

Kill osk.exe Process

Dim proc = Process.GetProcessesByName("osk")
For i As Integer = 0 To proc.Count - 1
proc(i).Kill()
Next i

Thanks, this was the answer that I was looking for.
Work fine now!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.