473,799 Members | 3,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find whether the proces is running or not?

Hi All,
I am working on Windows platform.
Is there any way to find out whether the given process running?

( History: I am using WaitForSingleOb ject. People advised me the
WaitForSingleOb ject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleOb ject. So I am trying to
check whether the given process is running)
Thanks
Sabiyur

Apr 16 '07 #1
2 3325
Sabiyur skrev:
Hi All,
I am working on Windows platform.
Is there any way to find out whether the given process running?

( History: I am using WaitForSingleOb ject. People advised me the
WaitForSingleOb ject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleOb ject. So I am trying to
check whether the given process is running)

Try

http://support.microsoft.com/kb/175030

--
OU
Apr 16 '07 #2
On Apr 16, 8:17 pm, "Sabiyur" <SabiyurRah...@ gmail.comwrote:
I am working on Windows platform.
Is there any way to find out whether the given process running?
( History: I am using WaitForSingleOb ject. People advised me the
WaitForSingleOb ject could hang if the process for which we are waiting
terminated earlier to calling WaitForSingleOb ject. So I am trying to
check whether the given process is running)
It depends on the system; Posix's waitpid(), for example, has a
WNOHANG option which effectively prevents blocking. On some
systems, you can set a timeout on the process wait, and setting
it to 0 effectively means to poll; this is the case for Window's
WaitForSingleOb ject, for example.

Otherwise, the classical solution is to spawn a separate thread,
and wait there.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 17 '07 #3

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

Similar topics

2
10356
by: Anand Pillai | last post by:
I would like to add a feature to one of my network programs. The requirement is to find out if a server is alive by sending it requests. I know of the standard ICMP ping, and searched for python modules able to 'PING'. The only hit I got was Jeremy Hiltons ping package, written for Python 1.4, and it does not work with the latest Python versions (2.0 upwards). Are there other ways of finding out (in a few lines of code) whether a server...
0
1366
by: sjaak538 | last post by:
Hello I have my own server running with MySQL, PHP..... and asterisk(VOIP) Sometime I have that so much visitors(search engines) that MySQL is taking all the processing time. Ive running also asterisk(VOIP) this must be goingon allways. I like to limit MySQL not to take more than 80% CPU speed. How to do this.
5
11048
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after setting stDataSource and stFileName to the desired values. Most of the time it works, but occasionally, typically as code changes are being made to the module, the following message appears:
90
5271
by: Bret Pehrson | last post by:
This message isn't spam or an advertisement or trolling. I'm considering farming some of my application development to offshore shops (I'm in the US). I have absolutely *no* experience w/ this, and therefore I'm looking for comments, suggestions, etc. on how to go about this w/o getting screwed. My current application development is primarily database-driven apps in C++/C#, so I'm looking for programmers w/ up-to-date skills.
1
1262
by: Jesper | last post by:
Hi, I've made a program runs in the background, ie not shown on the task bar but only with a tray icon next to the watch. If I use Alt+Tab its possible to select the program from the list of running applications. Is it possible to remove the program from the list of running applications? In the task manager the first tab page lists applications and the second lists running processes. Is it possible to make mu program a process instead...
3
4467
by: Primera | last post by:
I am trying to determine if a particular process is running. I think I am probably missing something obvious, but here is what I have so far... ManagementObjectSearcher msProcessCcmExec = new ManagementObjectSearcher("SELECT * FROM Win32_Process WHERE Name = 'CcmExec.exe'"); foreach (ManagementObject mo in msProcessCcmExec.Get()) { logWrite.WriteLine(mo.ToString() + " is
1
1894
by: theTone | last post by:
Hi all, We have noticed that using the Word OLE is much slower on dual processor machines. Limiting the processor affinity to one processor helps. So, I want to set the affinity in my C# code. I succeeded with the following code: oWord = new Word.Application(); Process wordProcesses = Process.GetProcessesByName("WINWORD");
0
1127
by: anups | last post by:
Im new to DB2.Im using DB2 client.I need to find out whether a procedure which I have started is still running in DB2.How do i find out that? Also if i fire a sql query and that locks some table how do i find out which tables have got locked and where the query is waiting
1
1521
by: Techidada | last post by:
Hi I am running a background command and want to mointor output of that commands which generate some flag files. When it finish it should be stopped. I tried this open(MON, "$CMD > output.txt |") || die "Can't start the $COMCOMM"; while (<MON>) { opendir(DIR, $dir) or die " Can't open $dir"; while ($file = readdir(DIR)) {
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10247
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.