Results 1 to 6 of 6

Thread: How can i tell if a program is running and is it in if..then...else

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    39

    How can i tell if a program is running and is it in if..then...else

    need to be able to tell if the login program is running. and then is it in an if then else statement
    Last edited by wildcard; Nov 14th, 2002 at 03:21 PM.

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I am not sure how you can tell which part of the code a pp is executing, ut you can find if a pp is running if you know the window caption. Use the FindWindow api call to determine if that particular application is currently running or not.

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    39
    uh whats the full call?
    my api viewer is nowhere to be found

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    VB Code:
    1. 'api call
    2. Private Declare Function FindWindow Lib "user32" _
    3. Alias "FindWindowA" (ByVal lpClassName As String, _
    4. ByVal lpWindowCaption As String) As Long
    5.  
    6. 'code
    7. Dim lngHwnd As Long
    8.  
    9. lngHwnd = FindWindow(vbNullString, "<your window caption>")
    10. If lngHwnd > 0 Then MsgBox "Window found"

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    39
    thx

  6. #6
    Hyperactive Member TupacShakur's Avatar
    Join Date
    Mar 2002
    Location
    Da Land Of Da Heartless...
    Posts
    493
    U can hide a window with this.. Hope this also helps.
    Attached Files Attached Files
    "And Now I'm Lika Major Threat, Cause I Remind U Of The Things U Were Made To Forget!" - (2PAC)

    "Now They Label Me a Lunatic, Couldn't Care Less, Death or Success is What I Quest, Cause I'm Fearless!" - (2PAC)

    " There's a light at the end of every tunnel, just pray it's not a train!! "



    I am 100% addicted to Tupac. What about you?
    I am 24% addicted to Counterstrike. What about you?
    The #1 Tupac Fans Web Site | The Official Tupac Web Site

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