473,473 Members | 4,257 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PrevInstance


Hi!
There is my code:

Shared Function PrevInstance() As Boolean
If
Ubound(Diagnostics.Process.GetProcessesByName(Diag nostics.Process.GetCurrent
Process.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

this dosn´t work in Windows 98 or Windows ME. How can I do to see if an
application is already running?

--
Cumprimentos,
David de Passos
--------------------------------------------------------------
RCSOFT, Lda.
E-Mail: pa****@rcsoft.pt
Móvel: +351 966931639
Telefone: +351 239708708
Fax: +351 239708701
Tel. Directo: +351 239708705 ext. 401

Nov 21 '05 #1
3 2019
Try this

http://www.thescarms.com/dotNet/SingleInstance.asp
"David de Passos" <pa****@rcsoft.pt> wrote in message
news:OQ**************@TK2MSFTNGP15.phx.gbl...

Hi!
There is my code:

Shared Function PrevInstance() As Boolean
If
Ubound(Diagnostics.Process.GetProcessesByName(Diag nostics.Process.GetCurrent
Process.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

this dosn´t work in Windows 98 or Windows ME. How can I do to see if an
application is already running?

--
Cumprimentos,
David de Passos
--------------------------------------------------------------
RCSOFT, Lda.
E-Mail: pa****@rcsoft.pt
Móvel: +351 966931639
Telefone: +351 239708708
Fax: +351 239708701
Tel. Directo: +351 239708705 ext. 401

Nov 21 '05 #2
Hi,

You are better off using a mutex to tell if there is another
instance of the app running.

http://www.windowsformsdatagridhelp....6-343ac05a7617

Ken
---------------------
"David de Passos" <pa****@rcsoft.pt> wrote in message
news:OQ**************@TK2MSFTNGP15.phx.gbl...

Hi!
There is my code:

Shared Function PrevInstance() As Boolean
If
Ubound(Diagnostics.Process.GetProcessesByName(Diag nostics.Process.GetCurrent
Process.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

this dosn´t work in Windows 98 or Windows ME. How can I do to see if an
application is already running?

--
Cumprimentos,
David de Passos
--------------------------------------------------------------
RCSOFT, Lda.
E-Mail: pa****@rcsoft.pt
Móvel: +351 966931639
Telefone: +351 239708708
Fax: +351 239708701
Tel. Directo: +351 239708705 ext. 401


Nov 21 '05 #3
"David de Passos" <pa****@rcsoft.pt> schrieb:
Shared Function PrevInstance() As Boolean
If
Ubound(Diagnostics.Process.GetProcessesByName(Diag nostics.Process.GetCurrent
Process.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

this dosn´t work in Windows 98 or Windows ME. How can I do to see if an
application is already running?


Error message? 'Process' is based on performance counters, make sure
performance counters are enabled.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

1
by: smith | last post by:
I was recently set to release an app that used very common single instance code and hit the oddest issue. After many hours of full build tests I believe that it is duplicatable. Environment: ...
3
by: Helene Day | last post by:
I am looking for the equivalent of this VB code: If App.PrevInstance Then End if Thanks, Helene (I am still learning about .NET)
8
by: Chris Thunell | last post by:
I have created a VB.net windows forms application. If I have the program running and then I mistakenly click on my desktop icon again, I get a second instance of the program running. Is there...
2
by: johnmann56 | last post by:
Hello. I have written a simple image viewer application using C# .NET. It only needs to display one image at a time. When a different program, in C, running on the same machine, does a...
9
by: Tolga Tanriverdi | last post by:
I made a gui program with c# but i want even if people double click my program more than once it would only open once is something like that possible if it is how?
4
by: Michael Passalacqua | last post by:
In VB.NET, how do you check to see if an instance of your application is already running? Michael Passalacqua Portland Community College CIS Faculty *** Sent via Developersdex...
3
by: Tom Edelbrok | last post by:
In the VB.Net documentation it says that there is no direct equivalent to VB6's 'PrevInstance' function, so they suggest making your own with the following code: Function PrevInstance() As...
7
by: Jaime Lucci | last post by:
There is any instruction that replace the App.PrevInstance which is used in VB6? Thanks.
3
by: Tom Rogers | last post by:
How do I make it so that once my application (.exe) is running, if the user tries to run a second instance of the program, it is not allowed. I want my program to be able to have only one...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.