I'll admit I haven't used the Win32::Process::Info before today but consider the following code:

use Win32::Process::Info my $st = Win32::Process::Info->import('NT', 'WMI'); my $pi = Win32::Process::Info->new (undef, 'WMI'); my @pids = $pi->ListPids (); my @info = $pi->GetProcInfo (); for my $prc (@info){ printf("%s, %s, %s\n", $prc->{"ProcessId"}, $prc->{"Name"}, $prc->{"Description"} ); }

When run, this code will make the cmd.exe session variously: a) run without error; b) fail with a "...has encountered a problem and needs to close..." dialog being shown; c) fail with a "The memory could not be 'read'." dialog being shown; d) hang until I terminate the perl.exe image manually with Task Manager. This appears, at least, not very robust to me.

Re: a 'native' way.. I tend to think if there's some CLI utility that produces some sort of useful output, there has to be a way that Perl can do the same (providing someone has built-up a module)... or at least if it's something that's managed/controlled by Windows, I should be able to call Windows to do my job for me, rather than starting from scratch; I just have this thing that I don't like to 'shell' to the OS -- it just seems to be like "giving-up" or something...(!)

...and I guess my queries in the Supersearch were lacking, 'coz somehow I didn't catch those Monks' site nodes, thanks.

I'll go and see if I can decipher the intricacies of Win32::GuiTest and Win32::API::Callback...


In reply to Re^2: How to Retrieve another Process' Window Title? by ozboomer
in thread How to Retrieve another Process' Window Title? by ozboomer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.