James S. Martin wrote:
>Hey folks,

>I'm trying to figure out how to use the SetupSup module(
>http://jenda.mccann.cz/perl/Setupsup.pm.html).
>The particular function I'm trying to use is:
>WaitForWindow($title, \$window, $timeout, [$refresh])
>Here's my code:

Well, James...
There are a number of issues with your code.  Typos?

>####
>use Win32::Setupsup;
>$title=Notepad;

First, always invoke your scripts with -w, and why not
use strict?  It woulda found these errors...

Anyway,
make sure to quote the exact title of the window:  $title = "Notepad";

or, better yet use a regex.  With a regex you need to use
WaitForAnyWindow instead of WaitForWindow.

Example:

$title = '^Notepad*';   # note single quotes!
Win32::Setupsup::WaitForAnyWindow($title, \$window,$timeout,$refresh);

>Win32::Setsup::WaitForWindow($title, \$window, "10000", "100");
                 ^^^^^^^
^^^^^^^^^^^^^^
Typo?  Should be Setupsup.           Since these are numbers, they shouldn't be
quoted.

>print "Window is there\n";
>####

With those changes it works fine for me.

>The script then errs out with:
>Usage:  Win32::Setupsup::WaitForWindow($title, \$window, $timeout,
>[$refresh])

Objecting to the "quoted" timeout and refresh arguments.

>Any ideas why it's doing this?  I'm able to do the EnumWindows function fine
>and print out all the Window names.

>But I don't understand what \$window is

Read perlref in your documentation.  References are your friend!

>or how to return it.

Ditto.. :-)

>Thanks,
>James

HTH,

-mm

--

Martin A. Miller, Systems Programmer, Bon Vivant At-Large & Stunt Borg.
Walgreens Corporate IT: Integration Architecture








---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to