Results 1 to 7 of 7
  1. #1
    carl g.
    Guest

    Active Application?

    Can anyone tell me how to find out which applications are active using VB6?

    Regards,

    Carl

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Active Application?

    Can you be more specific? Are you talking about executable programs like Word and Excel, are do you mean all the processes that you see in the task manager, or what? In NT/2000, there are also applications running as services, which you can't see, so are those included as well?
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Application?

    VBA has a Tasks object. Don't recall if VB does or not. You could:

    if Application.Tasks.Exists("Name of App") then
    bla bla
    endif
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Active Application?

    <VBA has a Tasks object> - but it's only available w/in Word VBA (who knows why?)

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Application?

    So, that means

    <pre>objWord = Getobject("Word.application")
    if objWord.Tasks.Exists("App Name") then
    bla bla
    endif
    set objWord = nothing
    </pre>


    would work?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    carl g.
    Guest

    Re: Active Application?

    Charlotte,

    To clarify: I need to know which executable programs are running.
    I tried using the Find windows API, but to get the hwnd for any executable you need to have the lpClassName argument. In MS Excel this is "XLMAIN". I'm not sure what the equivalent is (or how to find it) in the particular application that I am looking for (Business Objects 5.1)

    Thanks,

    Carl

  7. #7
    carl g.
    Guest

    Re: Active Application?

    I normally despair of the KB as I always get 500 topics returned for every search.

    This time it worked when searched on lpClassName:
    KB Q72918:
    HOWTO: VB Can Determine if Specific Windows Program Is Running.

    Thanks for the help everyone.

    Carl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •