I am a total nooby at this.
Can someone give me a simple script on how I can close any program running by clicking a button?
I tried
Private Sub Command1_Click()
end ("C:\Program Files\..")
End Sub
But it said syntax error
help please :)
Printable View
I am a total nooby at this.
Can someone give me a simple script on how I can close any program running by clicking a button?
I tried
Private Sub Command1_Click()
end ("C:\Program Files\..")
End Sub
But it said syntax error
help please :)
Welcome to the vbforums!
This question is probably better suited for the Classic VB forum.
The End method will quit your vb program. No parameters
needed. Usally you would want to unload any objects from
memory before you actuall end your program.
Here is the way to use the End method.
To end another 3rd party program may not beVB Code:
Private Sub Command1_Click() End End Sub
the best idea if the program is relying on the user logging out or
something else like closing connections to a database. You would
need to use some APIs to close another programs window like
FindWindow & PostMessage.
:)
I would suggest SendMessage if this is the case :)Quote:
Originally posted by RobDog888
FindWindow & PostMessage.
:)