Results 1 to 6 of 6

Thread: Finding out if a program is running

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Oregon
    Posts
    962

    Finding out if a program is running

    How do you find out if a program is running? In this case, it is another app I made.
    Involved in: Sentience

  2. #2
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142

    Re: Finding out if a program is running

    Originally posted by Gaming_World
    How do you find out if a program is running? In this case, it is another app I made.
    using API
    X <> Findwindow("class", vbNullString)
    if X = 0 Then Call Sendmessage(X, WM_Close, 0, 0)

    there was this same question b4, but i dont know how to
    hyperlink threads so i just wrote it over..
    ؊Ϯϊ

  3. #3
    Addicted Member Osiris's Avatar
    Join Date
    Oct 2000
    Location
    Dimension Hole
    Posts
    142
    err wrong again

    X = Findwindow("class", vbNullString)
    if X <> 0 Then Call Sendmessage(X, WM_Close, 0, 0)
    ؊Ϯϊ

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Oregon
    Posts
    962
    How do you find out the class of the object?
    Involved in: Sentience

  5. #5
    Hyperactive Member TiPeRa's Avatar
    Join Date
    Apr 2001
    Location
    In between
    Posts
    464
    Err, Gaming_World didn't say anything about closing the app!

    X = Findwindow("class", "title")
    If X <> 0 then MsgBox "The app is running!"

    Class is the class, if you wrote it in vb it is something like ThunderMain.
    Title is the title of the app, such as Project1 or SpaceInvaders2
    W#Ć€V€® W¦|| ߀ W¦|| ߀, ÄÑÐ †#€®€ ¦§ ÑÖ†#¦Ñ6 ¥Öµ ©ÄÑ ÐÖ ÄßÖµ† ¦†, §Ö §¦† ßÄ©K, ®€|ÄX ÄÑÐ |€† ¦† #ÄÞÞ€Ñ.
    (Whatever will be will be, and there is nothing you can do about it, so sit back, relax and let it happen.)

  6. #6
    Lively Member
    Join Date
    Dec 2001
    Location
    vienna, austria
    Posts
    118

    Talking

    and if you want to activate that program, use this code (found on vb-world):

    lngTemp = ShowWindowAsync(hWnds(1), SW_RESTORE)
    SetWindowPos hWnds(1), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
    sWindowText = Space(255)
    lngTemp = GetWindowText(hWnds(1), sWindowText, 255)
    sWindowText = Left(sWindowText, lngTemp)
    AppActivate sWindowText
    SetWindowPos hWnds(1), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE
    End

    hWnds(1) is the address given back by findWindow API
    visit me on www.big-nell.com to find out the truth

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