|
-
May 27th, 2004, 08:20 PM
#1
Thread Starter
New Member
Closing a running program.
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
-
May 29th, 2004, 05:29 PM
#2
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.
VB Code:
Private Sub Command1_Click()
End
End Sub
To end another 3rd party program may not be
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.
Last edited by RobDog888; May 29th, 2004 at 05:32 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 30th, 2004, 03:11 AM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|