Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2008 > Visual Basic 2008 Essentials
|
Visual Basic 2008 Essentials If you are new to Visual Basic programming with version 2008, this is the place to start your questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2008 Essentials section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2009, 06:44 PM
Authorized User
 
Join Date: Jun 2008
Posts: 33
Thanks: 2
Thanked 0 Times in 0 Posts
Default Not Apply Duplicate exe files to run?

Is there a way to prevent a vb exe file from being opened multiple times while its already running?

I have a program that I created that I have sitting in the sys tray and I don't want users to be able to open the program while it is already running. How do I do this?
 
Old June 11th, 2009, 07:35 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default There's a couple ways...

There are a couple ways. You can use mutex to check for multiple running applications

http://www.freevbcode.com/ShowCode.Asp?ID=5845

or you can grab all the processes running into a collection then loop through the process names and compare them to the running application and if it's the same exit the application. I bet someone else has a different way to do it as well.
__________________
Jason Hall

Follow me on Twitter @jhall2013
The Following User Says Thank You to alliancejhall For This Useful Post:
sanderson (June 12th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
run .exe in asp hostxxi Classic ASP Basics 0 June 18th, 2008 04:01 AM
KickStart to Find and Delete True Duplicate Files asgarcymed VBScript 0 November 24th, 2007 11:10 PM
How to run another .exe from my program shivendra C++ Programming 1 July 28th, 2006 04:56 AM
Regarding To run EXE from ASP vppatil_20 Classic ASP Components 1 September 9th, 2004 03:08 PM
Run an exe julesmel C# 1 August 6th, 2003 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.