How can i query application start ?
-
Hello there , I want to get handle of specific application before start ,but i don't know how can i get that message and process it . in fact , i don't know exactly which message , i must be process . Thank you .
DMASTER
-
Hello there , I want to get handle of specific application before start ,but i don't know how can i get that message and process it . in fact , i don't know exactly which message , i must be process . Thank you .
DMASTER
I think for get a handle to a program you need to run it.
-
I think for get a handle to a program you need to run it.
Dear Hamid, thanks to your reply. But, my question is that, when ever the user runs an application, how can i make a notification of that process start, in my own application. In fact, i want to query the process-start! I wonder if any system message (or any other method) exists, when an application starts?!
DMASTER
-
Dear Hamid, thanks to your reply. But, my question is that, when ever the user runs an application, how can i make a notification of that process start, in my own application. In fact, i want to query the process-start! I wonder if any system message (or any other method) exists, when an application starts?!
DMASTER
If you know name of program you can use of FindWindow but if you dont know name of program you can use of EnumDesktopWindows for Enumerates all windows or EnumWindows for enumerates all windows on the screen that it gives you a handle to each window.
-
If you know name of program you can use of FindWindow but if you dont know name of program you can use of EnumDesktopWindows for Enumerates all windows or EnumWindows for enumerates all windows on the screen that it gives you a handle to each window.
I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.
DMASTER
-
I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.
DMASTER
Hello Developer611, Sounds like you need SetWindowsHookEx() with WH_CBT. Look it up in MSDN. It may help you. - Bio.
-
I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.
DMASTER
You could monitor WMI for an event of the Win32_ProcessStartTrace Class[^]. Example: Receiving Event Notifications Through WMI[^] Code Project: Making WMI Queries In C++[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: