Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Win32::Setupsup quandry

by Grygonos (Chaplain)
on Jan 06, 2004 at 22:01 UTC ( #319263=perlquestion: print w/ replies, xml ) Need Help??
Grygonos has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I have the following test script

#!/perl -w use strict; use Win32::Setupsup; my @windows; Win32::Setupsup::EnumWindows(\@windows); foreach(@windows) { my @proptoget = qw(focused pid); my %windowprop; Win32::Setupsup::GetWindowProperties($_,@proptoget,\%windowprop); foreach my $key (keys(%windowprop)) { print $key."-".$windowprop{$key}."\n"; } }
that should grab all the windows and grab the values of the focused and pid property. However when I run the script I get the following usage error: Usage: Win32::Setupsup::GetWindowProperties($window, @proptoget, \%windowprop) I do have a valid window reference because printing $_ gives me the handle. focused and pid are valid properties. I am passing the empty hash by reference. What am I missing?

Thanks a TON in advance...

Grygonos

Comment on Win32::Setupsup quandry
Select or Download Code
Re: Win32::Setupsup quandry (guess)
by tye (Cardinal) on Jan 06, 2004 at 22:22 UTC

    I'd guess [correctly]1 that the usage message is just missing the \ before @proptoget. I'd check my guess but Win32::Setupsup is not [indexed]1 on CPAN so I gave up looking for it. Shame on the module author [for not following the documented conventions such that the module would get indexed (I presume2)]1.

                    - tye

    1 Updates

    2 I didn't download the *.zip, extract the files, read up on the conventions, etc. (I didn't go way out of my way to debug this module's problems.) If the module had been indexed in CPAN, then I could read the source (or documentation) directly with my browser (to name just a few of the advantages), so I don't feel too bad about being cheap with my time when it comes to "supporting" modules that can't manage to get that part right.

    I've been guilty of this myself, but I don't expect people to be generous with their time supporting my failures and I feel shame for it, so I'm not being a hypocrit. q-:

      tye, it is in CPAN, but something prevents it from showing up in any search.
      (reposted by request)

Re: Win32::Setupsup quandry
by boo_radley (Parson) on Jan 07, 2004 at 14:08 UTC

    Setupsup is a stone cold bitch an aggravating module to work with.
    There. I said it. It's difficult to find in CPAN, the documentation is lacking, its interface is funky, the error messages are lacking and it crashes in mysterious ways on different service packs. But it's the only game in town except for Win32::CtrlGui(a valiant effort there), which relies on setupsup; it's like putting a fresh coat of paint on a burning house.

    The answer to your question is to reference @proptoget : \@proptoget.

    And tye, it is in CPAN, but something prevents it from showing up in any search.

    Bonus Question : Guess what module I've been working with over the past two weeks?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://319263]
Approved by Theo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2014-04-23 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (551 votes), past polls