Click here to Skip to main content
15,890,609 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to get processes even if their name changed? Pin
Luc Pattyn31-Jan-08 1:34
sitebuilderLuc Pattyn31-Jan-08 1:34 
GeneralRe: How to get processes even if their name changed? Pin
CPallini31-Jan-08 2:15
mveCPallini31-Jan-08 2:15 
GeneralRe: How to get processes even if their name changed? Pin
Luc Pattyn31-Jan-08 2:34
sitebuilderLuc Pattyn31-Jan-08 2:34 
GeneralOK, 241270 013 27 Pin
CPallini31-Jan-08 2:48
mveCPallini31-Jan-08 2:48 
GeneralRe: How to get processes even if their name changed? Pin
spearwall31-Jan-08 4:16
spearwall31-Jan-08 4:16 
GeneralRe: How to get processes even if their name changed? Pin
Luc Pattyn31-Jan-08 5:19
sitebuilderLuc Pattyn31-Jan-08 5:19 
GeneralRe: How to get processes even if their name changed? [modified] Pin
spearwall31-Jan-08 17:12
spearwall31-Jan-08 17:12 
GeneralRe: How to get processes even if their name changed? Pin
Luc Pattyn31-Jan-08 22:22
sitebuilderLuc Pattyn31-Jan-08 22:22 
Hi,

1.
sorry for the delay, CodeProject e-mail notification is slow (again).

2.
you failed to answer my questions so what follows may not fit well with what you intend to do.

3.
when I develop two apps myself, one needing to check the other, I use a uniquely named mutex;
that works quickly and reliably, without causing all the GetProcesses and FileInfo overhead,
which may fail anyway for one of several reasons:
- you may not be allowed to see other user's processes;
- the other EXE size may change (because you modify it if it is your code, or you or
Windows Update or some other updater decides to update it, if it is not your code)
it certainly is a good approach for implementing a "single instance of application".

4.
your C# code seems a bit troubled:
- myProcesses[i+1] = p; will fail if you don't create the array first; and
then you don't know its exact size beforehand, so you would be better of using either
an ArrayList or a List< string>
- don't see why your index should start at -1 and [i+1] is used
- don't understand what the \ and \\ and @ comment is about, there are no literal paths
in the code as far as I can tell.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.


GeneralRe-initialization of the graph Pin
B!Z30-Jan-08 21:28
B!Z30-Jan-08 21:28 
GeneralRe: Re-initialization of the graph Pin
pmarfleet30-Jan-08 21:45
pmarfleet30-Jan-08 21:45 
GeneralPage reloaded when ContentType = "Application/vnd.msword" [modified] Pin
JohnAneston30-Jan-08 20:41
JohnAneston30-Jan-08 20:41 
Questionhow to display the tree nodes and its atrributes in the list format in multiline textbox Pin
samidhas30-Jan-08 20:28
samidhas30-Jan-08 20:28 
GeneralCreating Custom Emails from C# code Pin
SB 30-Jan-08 20:03
SB 30-Jan-08 20:03 
GeneralRe: Creating Custom Emails from C# code Pin
Ed.Poore30-Jan-08 23:00
Ed.Poore30-Jan-08 23:00 
GeneralRegarding certification.... Pin
tasumisra30-Jan-08 19:01
tasumisra30-Jan-08 19:01 
GeneralWrong forum Pin
pmarfleet30-Jan-08 21:47
pmarfleet30-Jan-08 21:47 
GeneralConnecting C#.Net to SQL Server 2000 Pin
klaydze30-Jan-08 17:31
klaydze30-Jan-08 17:31 
GeneralRe: Connecting C#.Net to SQL Server 2000 Pin
Rocky#30-Jan-08 20:19
Rocky#30-Jan-08 20:19 
GeneralRe: Connecting C#.Net to SQL Server 2000 Pin
Ashfield31-Jan-08 0:06
Ashfield31-Jan-08 0:06 
GeneralCatching specialty keys from keyboard [modified] Pin
Jordanwb30-Jan-08 10:16
Jordanwb30-Jan-08 10:16 
GeneralRe: Catching specialty keys from keyboard Pin
DaveyM6930-Jan-08 10:43
professionalDaveyM6930-Jan-08 10:43 
GeneralRe: Catching specialty keys from keyboard Pin
Jordanwb30-Jan-08 10:54
Jordanwb30-Jan-08 10:54 
GeneralRe: Catching specialty keys from keyboard Pin
TJoe30-Jan-08 10:57
TJoe30-Jan-08 10:57 
GeneralRe: Catching specialty keys from keyboard Pin
Jordanwb30-Jan-08 11:32
Jordanwb30-Jan-08 11:32 
GeneralRe: Catching specialty keys from keyboard Pin
Dan Neely31-Jan-08 2:47
Dan Neely31-Jan-08 2:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.