|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Detecting system events with the help of C# Hello, I have requirement to create a small application that can detect the opening / closing an application on the machine. And must also ensure that it should work fine on the large quantity of data . I have tried searching for this kind of requirement but unable to find on the internet so i came here, and that requirement is in the C # and I have no idea realization ... If anyone has any suggestion please let me know. Thank you in advance |
#2
| |||
| |||
Re: Detecting system events with the help of C# According to me Detecting the opening or closing of an application at real time cannot be predict... Against the method by Process.getProcess allows to know all the processes running, so you are allowed to can call this method regularly (with a timer for example) and can compare the results to see if a process was started or stopped. To find out which application is active, it must pass through the native Windows functions Invoke by DllImport attribute. I am not sure about exactly what functions because I have to reinstall my PC and I have not yet installed the MSDN doc ... |
#3
| |||
| |||
Re: Detecting system events with the help of C# Ok thank you very much, I understood little about it, but if I will get more information and if i will study myself on this point I hope I would definitely be able to find the appropriate solution on it otherwise you already give me a place to look some more in it,I will consider very good start for me. |
#4
| |||
| |||
Re: Detecting system events with the help of C# You may also find your little code from here: GetForegroundWindow This is the method that returns the handle of the active window. You can declare it like this: Code: using System. Runtime. InteropServices; ... [DllImport ( "user32.dll")] public static extern IntPtr GetForegroundWindow (); Code: [DllImport ( "user32.dll")] public static extern long GetWindowThreadProcessId (IntPtr hWnd, ref long lpdwProcessId); |
![]() |
|
Tags: large quantity, programming language, system events |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
System not detecting WD caviar green 2TB | Agavoli | Hardware Peripherals | 4 | 30-08-2011 11:02 PM |
TrueCrypt is not detecting my non system drive | Gania | Networking & Security | 4 | 26-12-2010 03:42 AM |
Where is System Events in mac? | Cristoffer | Operating Systems | 5 | 30-05-2010 12:33 AM |
NEC: a system for detecting illegal video upload | Glenny | Technology & Internet | 2 | 09-05-2010 05:57 AM |
System hangs on Detecting IDE Drives | Snake08 | Windows Software | 3 | 16-11-2009 10:40 PM |