|
-
Nov 26th, 1999, 01:46 AM
#1
Thread Starter
Lively Member
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.
-
Nov 26th, 1999, 02:03 AM
#2
Member
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
-
Nov 26th, 1999, 06:17 AM
#3
Thread Starter
Lively Member
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
-
Nov 26th, 1999, 06:30 AM
#4
New Member
Hello,
Here's an quick and easy way to do the search
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")
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"
-
Nov 26th, 1999, 06:37 AM
#5
Thread Starter
Lively Member
AyS I don't want to do this with a timer i want to detect te execution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|