in reply to Re: How to Retrieve another Process' Window Title?
in thread How to Retrieve another Process' Window Title?
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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to Retrieve another Process' Window Title?
by BrowserUk (Patriarch) on Feb 07, 2011 at 03:11 UTC | |
|
Re^3: How to Retrieve another Process' Window Title?
by Anonymous Monk on Feb 07, 2011 at 03:31 UTC | |
by ozboomer (Friar) on Feb 07, 2011 at 03:49 UTC | |
by Anonymous Monk on Feb 07, 2011 at 05:36 UTC | |
by ozboomer (Friar) on Feb 07, 2011 at 21:17 UTC |