PDA

Click to See Complete Forum and Search --> : Program execution


Antonio Begue
Nov 26th, 1999, 12:46 AM
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.

Juillet
Nov 26th, 1999, 01:03 AM
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

Antonio Begue
Nov 26th, 1999, 05:17 AM
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

AyS
Nov 26th, 1999, 05:30 AM
Hello,

Here's an quick and easy way to do the search

--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")


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.



------------------
-Matti Kiviranta
AyS of AyS Systems
Move yourrr body
"Eiffel65 - Move your body"

Antonio Begue
Nov 26th, 1999, 05:37 AM
AyS I don't want to do this with a timer i want to detect te execution