Click here to Skip to main content
15,915,336 members
Home / Discussions / C#
   

C#

 
GeneralSerialization Pin
Not Active23-Mar-04 10:06
mentorNot Active23-Mar-04 10:06 
GeneralRe: Serialization Pin
Heath Stewart23-Mar-04 10:37
protectorHeath Stewart23-Mar-04 10:37 
GeneralRe: Serialization Pin
Not Active23-Mar-04 10:48
mentorNot Active23-Mar-04 10:48 
GeneralC#->C++ Interface Issue - Passing Data Pin
Chris_Lutz23-Mar-04 7:58
Chris_Lutz23-Mar-04 7:58 
GeneralRe: C#->C++ Interface Issue - Passing Data Pin
Heath Stewart23-Mar-04 9:04
protectorHeath Stewart23-Mar-04 9:04 
GeneralDetect new running process Pin
Apusnaias23-Mar-04 5:53
Apusnaias23-Mar-04 5:53 
GeneralRe: Detect new running process Pin
Dave Kreskowiak23-Mar-04 6:12
mveDave Kreskowiak23-Mar-04 6:12 
GeneralRe: Detect new running process Pin
Heath Stewart23-Mar-04 9:16
protectorHeath Stewart23-Mar-04 9:16 
You could also implement a system hook (see Using Hooks from C#[^]) using the WH_CBT message to no when a window is being created, but this doesn't necessarily mean a process is being started. You can P/Invoke GetWindowModuleFileName to pass the HWND (as an IntPtr) and get the path to the module that loaded it. If you keep these in a lookup table (like a Hashtable), then you could quickly see if the process was already loaded. If not, add it and run your "event" handler.

Otherwise Dave's idea should work, but as he said it's untested. I've used WMI events for other things, so it should work.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Detect new running process Pin
Apusnaias23-Mar-04 11:22
Apusnaias23-Mar-04 11:22 
GeneralRe: Detect new running process Pin
Dave Kreskowiak23-Mar-04 11:46
mveDave Kreskowiak23-Mar-04 11:46 
GeneralRe: Detect new running process Pin
Apusnaias23-Mar-04 23:30
Apusnaias23-Mar-04 23:30 
GeneralRe: Detect new running process Pin
ian mariano23-Mar-04 11:20
ian mariano23-Mar-04 11:20 
GeneralRe: Detect new running process Pin
Robert M Greene26-Oct-04 7:39
Robert M Greene26-Oct-04 7:39 
GeneralGraphics.MeasureString Pin
compbssn200323-Mar-04 5:30
compbssn200323-Mar-04 5:30 
GeneralRe: Graphics.MeasureString Pin
Heath Stewart23-Mar-04 5:33
protectorHeath Stewart23-Mar-04 5:33 
GeneralRe: Graphics.MeasureString Pin
leppie23-Mar-04 6:06
leppie23-Mar-04 6:06 
GeneralRe: Graphics.MeasureString Pin
compbssn200323-Mar-04 19:20
compbssn200323-Mar-04 19:20 
GeneralExposing constituent control properties in VS.NET Pin
Matt Davison23-Mar-04 5:07
Matt Davison23-Mar-04 5:07 
GeneralRe: Exposing constituent control properties in VS.NET Pin
Heath Stewart23-Mar-04 5:30
protectorHeath Stewart23-Mar-04 5:30 
GeneralRe: Exposing constituent control properties in VS.NET Pin
Heath Stewart23-Mar-04 8:16
protectorHeath Stewart23-Mar-04 8:16 
QuestionHow can I do the following... Pin
profoundwhispers23-Mar-04 4:36
profoundwhispers23-Mar-04 4:36 
AnswerRe: How can I do the following... Pin
Heath Stewart23-Mar-04 4:54
protectorHeath Stewart23-Mar-04 4:54 
GeneralRe: How can I do the following... Pin
profoundwhispers23-Mar-04 5:08
profoundwhispers23-Mar-04 5:08 
GeneralRe: How can I do the following... Pin
Heath Stewart23-Mar-04 5:26
protectorHeath Stewart23-Mar-04 5:26 
Generalinput a barecode Pin
tonaxxl23-Mar-04 4:18
tonaxxl23-Mar-04 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.