DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 30 Jul 2007 13:42:26 -0400,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    Dan
          2    Erwin Zwart Erwin DOT Zwart AT pts DOT nl
          3    ctacke/ ctacke[at]opennetcf[dot]com


Check if app is already running?   
Can anyone point me in the right direction to check if the application is 
already running for a .NET CF 2.0 application?

Code for the regular .NET framework does not work because it uses
process.GetCurrentProcess.MainWindowHandle

which is not supported in the CF.



Dan
Date:Mon, 30 Jul 2007 13:42:26 -0400   Author:  

Re: Check if app is already running?   
You need to P/Invoke CreateToolhelp32Snapshot, Process32First  and 
Process32Next .
you can also use OpenNetCF.org and use the OpenNETCF.Toolhelp namespace.

Hope this helps

Erwin Zwart

"Dan"  wrote in message 
news:Ober4Et0HHA.600@TK2MSFTNGP05.phx.gbl...

> Can anyone point me in the right direction to check if the application is 
> already running for a .NET CF 2.0 application?
>
> Code for the regular .NET framework does not work because it uses
> process.GetCurrentProcess.MainWindowHandle
>
> which is not supported in the CF.
>
>
>
> Dan
>
> 
Date:Tue, 31 Jul 2007 09:05:07 +0200   Author:  

Re: Check if app is already running?   
For your own process just create a named system mutex (P/Invoke CreateMutex 
or use the OpenNETCF.Threading.NamedMutex).  On startup, create and hold it. 
If it already exists at that point, you know another instance is running.


-- 

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com



"Dan"  wrote in message 
news:Ober4Et0HHA.600@TK2MSFTNGP05.phx.gbl...

> Can anyone point me in the right direction to check if the application is 
> already running for a .NET CF 2.0 application?
>
> Code for the regular .NET framework does not work because it uses
> process.GetCurrentProcess.MainWindowHandle
>
> which is not supported in the CF.
>
>
>
> Dan
>
> 
Date:Tue, 31 Jul 2007 06:45:19 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us