by Shiv Nath Roy (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 21st May 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This is a code for closing of running .exe file.
'let it will be calc.exe, and the path is c:\windows\system32\calc.exe
'We are going to put this code on a command botton click event name Cmd1_Click
Dim r As Double
Private Cmd1_Click()
r = shell ("c:\windows\system32\calc.exe")
End Sub
'Now we are going to stop the excuted .exe file.
'For that we are going to put this code on a command botton click event
'name Cmd2_Click
Private Cmd2_Click()
AppActivate r 'For activated application (in any State)
SendKeys "%{F4}", true
End Sub