473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Is there some way to watch for when a program starts without constantly polling?

I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.
Nov 16 '05 #1
4 1805
not .Net per se but WMI has events that handle this kind of stuff - you must
have the System.Management librairies installed

the Win32_ProcessStartTrace event - indicates that a new process has started

class Win32_ProcessStartTrace : Win32_ProcessTrace
{
uint4 PageDirectoryBase;
string ParentProcessName;
uint32 ProcessID;
string ProcessName;
uint8 SECURITY_DESCRIPTOR[];
uint32 SessionID;
uint8 Sid[];
uint8 TIME_CREATED;
};

check out the microsoft.public.dotnet.framework.wmi news group for more info
;-)
"Michael Brown" <mr********@cox.net> wrote in message
news:97****************************@phx.gbl...
I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.

Nov 16 '05 #2
I found some info on PsSetCreateProcessNotifyRoutine()
this sounds like what I am looking for. However I can't find any C#
examples or an MSDN page talking about it, any help would be
appreciated.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
-----Original Message-----
I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.
.


I found a way I belive using PsSetCreateProcessNotifyRoutine()
does anyone know how to use this in .NET?
Nov 16 '05 #4
http://www.codeproject.com/threads/p...asp?print=true
"Michael Brown" <mr********@cox.net> wrote in message
news:97****************************@phx.gbl...
I would like to know if .NET has some sort of event that
I can write a method for or something similar for when an
application of my choosing starts.

Nov 16 '05 #5

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

Similar topics

2
by: John Viele | last post by:
Every time I create ASP.NET pages that do any significant data access, I find myself having to deal with the same problems: managing data object creation, the SQL connection object especially. ...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
3
by: sanjana | last post by:
hi i want to fire an event if the screen saver starts up i have done it using a timer tick event where i have used the api function to detect if screensaver has started..but this means continuous...
1
by: et | last post by:
How do I add a watch, using asp.net in visual studio, to stop the program when a value in a drop down list changes? I can add a watch through Debug, windows, watch, but there doesn't seem to be a...
1
by: Gunnar | last post by:
Are there any way of detecting that a program have crashed and left an orphan file? I have tried with the filesystemwatcher, but that didn't work. Maybe I can use a polling strategy and keep...
1
by: J Rice | last post by:
I have a question: When should syslog.closelog() be called? I have a daemon that spends most of its time asleep and quiet, but writes messages to the mail log when active. Should I open the...
5
by: zwasdl | last post by:
In Access VBA, the immediate window only displays a couple hundred lines of my debug output. How do I display more lines there, for example 500 lines, or even 5000 lines? Is there a way to set the...
3
by: tshad | last post by:
I have a program that is reading one of my mailboxes. It is polling the mailboxes ever 5 minutes to see if there is a message or not. Is this how Outlook does it (using Exchange as the...
14
by: Mohamed Mansour | last post by:
Hey there, this will be somewhat a long post, but any response is appreciated! I have done many PInvoke in the past from C++ to C#, but I did PInvoke within C# not C++/CLI. Can someone explain...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...
0
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...

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.