Results 1 to 5 of 5

Thread: Program execution

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Guayaquil, Guayas, Ecuador
    Posts
    87

    Post

    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.

  2. #2
    Member
    Join Date
    Jul 1999
    Posts
    40

    Post

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Guayaquil, Guayas, Ecuador
    Posts
    87

    Post

    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

  4. #4
    New Member
    Join Date
    Nov 1999
    Posts
    8

    Post

    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"

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Guayaquil, Guayas, Ecuador
    Posts
    87

    Post

    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
  •  



Click Here to Expand Forum to Full Width