473,758 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1830
not .Net per se but WMI has events that handle this kind of stuff - you must
have the System.Manageme nt librairies installed

the Win32_ProcessSt artTrace event - indicates that a new process has started

class Win32_ProcessSt artTrace : Win32_ProcessTr ace
{
uint4 PageDirectoryBa se;
string ParentProcessNa me;
uint32 ProcessID;
string ProcessName;
uint8 SECURITY_DESCRI PTOR[];
uint32 SessionID;
uint8 Sid[];
uint8 TIME_CREATED;
};

check out the microsoft.publi c.dotnet.framew ork.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 PsSetCreateProc essNotifyRoutin e()
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 PsSetCreateProc essNotifyRoutin e()
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
1333
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. Problem 1: If I have a pile of data adapters on a page, I typically only need a single SQL connection object, though the designer always tries to add a new one for each data adapter. So I have to manually weed out the extras and set the data...
9
2937
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 a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
3
9271
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 polling at each timer click.. private void tick(object sender, System.EventArgs e) { const int SPI_GETSCREENSAVERRUNNING = 114; int screenSaverRunning = -1; // is the screen saver running?
1
2258
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 way to have it stop the program if and when the value changes, I never see it in the watch because the program ends before the value changes. I have stepped through my entire code, and at the very last second of the program a drop down list...
1
1938
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 polling the file and check if it is locked. But can I do this without trying to open the file and catch exeption. Any suggestions are welcome? Regards
1
1803
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 log at the start and keep it open until the program closes? This seems much simpler than issuing three commands everytime I want to write to the log. The program will essentially be running constantly. Is having the log constantly "open" a...
5
6332
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 line size in access VBA? How do I see the complete content of a string variable while I'm debuging without writing code to output it? The values in watch window is truncated. Thanks a lot!
3
1719
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 server)? It doesn't seem to. When a message gets to Exchange, it seems to do some type of Push to Outlook as Outlook has it immediately. If so, ss there a way to make my program do that in VS. We are getting
14
3788
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 more why C++/CLI would be better to PInvoke than doing the PInvoke in C#? Because, usually in C# as you already know we use DLLImport and extern
0
9492
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
10076
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9908
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
8744
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
7287
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
6564
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
5175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3832
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3402
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.