Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > List Running Applications on Win32 (!Processes)

Reply
Thread Tools

List Running Applications on Win32 (!Processes)

 
 
Francis Libble
Guest
Posts: n/a
 
      02-17-2004
Dear All

Can someone tell me how to get a list of running applications on
Win32?
I am essentially looking to get the same list as appears in the
Applications tab of the Windows Task Manager. I can easily get the
equivalent of the Processes tab in Windows Task Manager (using
Win32::Setupsup or Win32::IProc) but I can't seem to find a way to
retrieve only the running applications.

Enumerating Window titles doesn't give me what I am looking for either
(hidden windows with titles show up)

Thanks

Flibble
 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      02-17-2004
Francis Libble wrote:
> Dear All
>
> Can someone tell me how to get a list of running applications on
> Win32?
> I am essentially looking to get the same list as appears in the
> Applications tab of the Windows Task Manager. I can easily get the
> equivalent of the Processes tab in Windows Task Manager (using
> Win32::Setupsup or Win32::IProc) but I can't seem to find a way to
> retrieve only the running applications.
>
> Enumerating Window titles doesn't give me what I am looking for either
> (hidden windows with titles show up)
>


Win32:erfLib (part of libwin) or Win32:rocess::Info (my preference).

Cheers,
Rob

--
To reply by email u have to take out the u in kalinaubears.

 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      02-17-2004
Sisyphus wrote:

>
> Win32:erfLib (part of libwin) or Win32:rocess::Info (my preference).
>


Oops - now that I read your post properly I'm not sure that either of
those modules supply what you want. Check them out, anyway

Cheers,
Rob


--
To reply by email u have to take out the u in kalinaubears.

 
Reply With Quote
 
Petri
Guest
Posts: n/a
 
      02-18-2004
In article < >, Francis Libble
says...
> Can someone tell me how to get a list of running applications on
> Win32?
> I am essentially looking to get the same list as appears in the
> Applications tab of the Windows Task Manager.


Yes, I wonder where you'd get that information...
It isn't available in any of the Win32_Process class properties anyway, I looked
through them.
There are some that sound good:
---8<---
#!/usr/bin/perl -w
use strict;
use warnings;
use Win32::OLE qw(in);

my $wmi;
eval {
$wmi = Win32::OLE->GetObject("winmgmts:");
};

unless ($@) {
my $proc_set;
eval {
$proc_set = $wmi->InstancesOf('Win32_Process');
};
die ("InstancesOf failed: ", Win32::OLE->LastError, "\n") if ($@);
printf "%-6s%-20s%-20s%-20s\n", 'PID', 'Name', 'Caption', 'Description';
printf "%-6s%-20s%-20s%-20s\n", '-' x 5, '-' x 19, '-' x 19, '-' x 19;
foreach my $proc (in($proc_set)) {
printf "%-6s%-20s%-20s%-20s\n", $proc->{'ProcessID'}, $proc->{'Name'},
$proc->{'Caption'}, $proc->{'Description'};
}
} else {
die "Win32::OLE->GetObject failed: ", Win32::OLE->LastError, "\n";
}
---8<---

But no...

There is a utility in the Win2K Resource Kit called tlist.exe, which will print
running processes by pid, name AND if available, the very string that you are
looking for.
You could use the output of that program to capture your data.

It won't show threads of applications though, like iexplore.exe for example.
If you start several iexplore.exe, they will all show.
If you start one iexplore.exe, and press ctrl-n or right_click->"Open link in
new window", the following windows will not show up, making the list shorter
than in Task Manager.
That's expected, tlist.exe lists processes by pid, not by thread.

What do you need this for?
Are you planning to do something with SendKeys?

Hope this helps!

Petri

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax Applications (75 links) : Sites/applications featuring/using Ajax. www.web20developers.com HTML 0 10-06-2006 03:28 AM
retrieve list of currently running user applications in Java shraddha Java 10 05-31-2005 04:01 AM
Difference between Python CGI applications and Php applications praba kar Python 2 05-04-2005 06:49 PM
Mystery of Java applications blocking Windows XP applications Wolfgang Java 5 02-19-2004 02:45 PM
web applications versus. web portal applications John Davis ASP .Net 0 08-21-2003 12:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57