473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Only one app running at a time

Hi,

Anyone knows the answer to this one: I have .NET application that I want to
allow at most one to be running at any given time. If one is already running
bring it to the front if someone tries to run it again. This seems pretty
standard in Win32 but I just wonder if there is .NET way to do the same
without pinvoke. Appreciate it. Thanks.

Tom
Jul 21 '05 #1
3 1567
i have seen Herfried's detection routines and am using one almost verbatim
in my app. (it works good - thanks Herfried!) But, i would still like to
know what the process is to activate an existing instance once it is
detected. if you learn anything on this, Tom, please post back!

thanks! =)

"Tom Garik" <to******@ok.com> wrote in message
news:vo************@corp.supernews.com...
Hi,

Anyone knows the answer to this one: I have .NET application that I want to allow at most one to be running at any given time. If one is already running bring it to the front if someone tries to run it again. This seems pretty
standard in Win32 but I just wonder if there is .NET way to do the same
without pinvoke. Appreciate it. Thanks.

Tom

Jul 21 '05 #2
Thanks Herfried and all. As for bringing existing instance to the front I
think you might be able to use
Control.FromHandle(process.MainWindowHandle).Bring ToFront() after getting
the process using PrevInstance(). Haven't tried it yet but it should work.
"K. Shier" <ks*****@spamAtYourOwnRisk.yahoo.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
i have seen Herfried's detection routines and am using one almost verbatim
in my app. (it works good - thanks Herfried!) But, i would still like to
know what the process is to activate an existing instance once it is
detected. if you learn anything on this, Tom, please post back!

thanks! =)

"Tom Garik" <to******@ok.com> wrote in message
news:vo************@corp.supernews.com...
Hi,

Anyone knows the answer to this one: I have .NET application that I want

to
allow at most one to be running at any given time. If one is already

running
bring it to the front if someone tries to run it again. This seems pretty standard in Win32 but I just wonder if there is .NET way to do the same
without pinvoke. Appreciate it. Thanks.

Tom


Jul 21 '05 #3
i will check it out, thanks! =)

"Tom Garik" <to******@ok.com> wrote in message
news:vo************@corp.supernews.com...
Thanks Herfried and all. As for bringing existing instance to the front I
think you might be able to use
Control.FromHandle(process.MainWindowHandle).Bring ToFront() after getting
the process using PrevInstance(). Haven't tried it yet but it should work.
"K. Shier" <ks*****@spamAtYourOwnRisk.yahoo.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
i have seen Herfried's detection routines and am using one almost verbatim
in my app. (it works good - thanks Herfried!) But, i would still like to know what the process is to activate an existing instance once it is
detected. if you learn anything on this, Tom, please post back!

thanks! =)

"Tom Garik" <to******@ok.com> wrote in message
news:vo************@corp.supernews.com...
Hi,

Anyone knows the answer to this one: I have .NET application that I want
to
allow at most one to be running at any given time. If one is already

running
bring it to the front if someone tries to run it again. This seems

pretty standard in Win32 but I just wonder if there is .NET way to do the

same without pinvoke. Appreciate it. Thanks.

Tom



Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris Callahan | last post by:
Greetings: Long time reader, first time poster. Here we go: ==Specific question: Does there exist in MySQL a privilege configuration which will allow an account to issue `SHOW MASTER...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
9
by: ataraxia2500 | last post by:
I have a little exe that is used to launched a daemon and a gui: #include <stdlib.h> int main(void) {     (void)system("daemon.exe");     (void)system("gui.exe");     return 0; }
18
by: jacob navia | last post by:
In C, we have read-only memory (const), read/write memory (normal data), and write only memory. Let's look at the third one in more detail. Write only memory is a piece of RAM that can only...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
4
by: Samuel R. Neff | last post by:
Most of the time what I've read is that to keep only one instance of an app running one should use a Mutex. However, we have an existing app that uses GetProcessByName() to ensure only one...
0
by: DaveK777 | last post by:
I'm about to start development on a new project in PHP, which I've never used before. I got the latest version (5.1.4) installed and running on my dev/test server, and I tried enabling APC since...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
2
by: seb | last post by:
Hi, this simple server (time protocol) does not respond after a few hours, even when it is restarted. The behaviour looks to me like a firewall blocking but I have desabled the firewall. Using...
7
by: Sin Jeong-hun | last post by:
I've using thread a lot in C#, but all of them were just single method with no return value or paramenters. It may sound bizarre but, can't it be a class? I'm writing an Windows application that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.