473,425 Members | 1,647 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,425 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 1807
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...
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
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.