Can a vb program detect a program execution like calc or notepad, so everytime the calc is executed i can perform something or something like that.
Printable View
Can a vb program detect a program execution like calc or notepad, so everytime the calc is executed i can perform something or something like that.
Yes
You would need to use a time and check for the hwnd of the Calc program...if the hwnd is active then do whatever.
As to the exact code of how to, I haven't done it yet: I only know it can be done
I know that with a timer you can but i want to know if it is posible to detect te execution, no verify if a program is runing with a timer, i want to detect the execution
Hello,
Here's an quick and easy way to do the search
so if you put that in to a timer and put that timer running and you open Calculator you will have terrible time clicking on the message boxes that will pop on to your screen.Code:--This to a module--
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
--this to the form --
Private Const APP_NAME = "Calculator"
If FindWindow(vbNullString, APP_NAME) Then MsgBox ("Calculator is active")
------------------
-Matti Kiviranta
AyS of AyS Systems
Move yourrr body
"Eiffel65 - Move your body"
AyS I don't want to do this with a timer i want to detect te execution