David Hiltz wrote:
>  Let's say I have a button in a window and all I know is the
>  location of the button.  I can use 'WindowFromPoint' to
>  return a handle on the button, eg.
>
>      $OBJ = Win32::GUI::WindowFromPoint($x,$y);
>
>  My problem is I can't manipulate the button using the 
>  returned handle, eg.
>
>   $OBJ->Resize(10,50);
>
>  If I try this, I get the message:
>
>     Can't call method "Resize' without
>     a package or object reference
>
>  Any ideas?

yes, you're treating your button as a non-owned window
(eg you have its handle only). in the documentation,
page General Concepts, there's a section that explains
how to treat these windows.
basically, using:

    $OBJ->Resize( 10, 50 );

to Perl is internally equivalent to:

    Win32::GUI::Resize( $OBJ, 10, 50 );

which, if $OBJ is a Win32::GUI object, is internally
equivalent to:

    Win32::GUI::Resize( $OBJ->{-handle}, 10, 50 );

everything is resolved, in the end, to the numerical handle 
that identifies the window and that is passed to the
underlying Windows API.
in your case, you already have this handle, so the solution 
is:

    Win32::GUI::Resize( $OBJ, 10, 50 );

hope this helps ;-)

__END__
# Aldo Calpini
print sort {$_{$a} cmp $_{$b}} values %{{split undef, 
"xritajbugne fahokem csuctawer jhdtlrnpqloevkshpr"}};




Reply via email to