PC Review


Reply
Thread Tools Rate Thread

Checking for other running CF applications

 
 
Andrew Mac
Guest
Posts: n/a
 
      21st Sep 2004
I've had success in using the various "CreateMutex" procs to stop
multiple instances of the same application but I've been unable to
find some code to check for other running named processes. In eVB I
managed to just use Mutex for that as well but it's not triggering any
code I write to trap it in VB .Net on the compact framework. Any
ideas, comments, samples would be welcome. These other applications
may be multi-form apps.

Thanks!
 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      21st Sep 2004
Mutexes work the same no matter what environment your code is written in.
What, exactly, are you trying to achieve? You want to prevent application B
from running when application A is already running?

Paul T.

"Andrew Mac" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've had success in using the various "CreateMutex" procs to stop
> multiple instances of the same application but I've been unable to
> find some code to check for other running named processes. In eVB I
> managed to just use Mutex for that as well but it's not triggering any
> code I write to trap it in VB .Net on the compact framework. Any
> ideas, comments, samples would be welcome. These other applications
> may be multi-form apps.
>
> Thanks!



 
Reply With Quote
 
Andrew Mc
Guest
Posts: n/a
 
      22nd Sep 2004
Hi,

Yep. I want to stop application B from running when application a is
active. I can use the mutex code to check for multiple instances of a
single app but I've been unable to get it to work for a different app in
compact framework for some reason. Do you have any sample code you know
works? This would be appreciated.

Thanks




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      22nd Sep 2004
Andrew Mc <(E-Mail Removed)> wrote:
> Yep. I want to stop application B from running when application a is
> active. I can use the mutex code to check for multiple instances of a
> single app but I've been unable to get it to work for a different app in
> compact framework for some reason. Do you have any sample code you know
> works? This would be appreciated.


What does your mutex code look like? So long as you use the same mutex
name in both applications, it should work fine.

(The compact framework stops multiple instances of the same app from
starting anyway.)

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      22nd Sep 2004
> (The compact framework stops multiple instances of the same app from
> starting anyway.)


Just to clarify... the statement above is only true for Pocket PC devices...

Cheers
Daniel


"Jon Skeet [C# MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Andrew Mc <(E-Mail Removed)> wrote:
> > Yep. I want to stop application B from running when application a is
> > active. I can use the mutex code to check for multiple instances of a
> > single app but I've been unable to get it to work for a different app in
> > compact framework for some reason. Do you have any sample code you know
> > works? This would be appreciated.

>
> What does your mutex code look like? So long as you use the same mutex
> name in both applications, it should work fine.
>
> (The compact framework stops multiple instances of the same app from
> starting anyway.)
>
> --
> Jon Skeet - <(E-Mail Removed)>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too



 
Reply With Quote
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      22nd Sep 2004
Daniel Moth <(E-Mail Removed)> wrote:
> > (The compact framework stops multiple instances of the same app from
> > starting anyway.)

>
> Just to clarify... the statement above is only true for Pocket PC devices...


Ooh... didn't know that. Cheers

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      22nd Sep 2004
As Jon said, the code should be exactly the same for either case. If you
want app B to check for app A before it runs, have app A create a named
mutex when it starts. When app B starts, check for the existence of the
mutex. If it's there, exit app B immediately. When app A exits, it should
close the mutex handle it got from CreateMutex, of course.

Paul T.

"Andrew Mc" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> Yep. I want to stop application B from running when application a is
> active. I can use the mutex code to check for multiple instances of a
> single app but I've been unable to get it to work for a different app in
> compact framework for some reason. Do you have any sample code you know
> works? This would be appreciated.
>
> Thanks
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for a running app L3Tech Microsoft Excel Programming 1 19th Jan 2006 01:01 AM
Vba - Checking if running ajliaks Microsoft Excel Programming 2 11th Sep 2004 06:09 PM
checking if app is running already? =?Utf-8?B?RGVhc3Vu?= Microsoft Dot NET 3 18th May 2004 03:18 PM
Checking if running MadCrazyNewbie Microsoft VB .NET 4 13th Apr 2004 06:18 PM
Checking if the database is running Cheickna Traoré Microsoft Access 0 6th Nov 2003 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:53 AM.