use strict; use Win32::API; my $handle=shift; my @rect=getWindowRect($handle); boxWindow(@rect); ############### sub boxWindow{ #??? } ############### sub getWindowRect { my $hwnd = shift || return; my $GetWindowRect = new Win32::API("user32", "GetWindowRect", ['N', 'P'], 'N') || return $^E; my $RECT = pack("iiii", 0, 0); $GetWindowRect->Call($hwnd, $RECT); return wantarray ? unpack("iiii", $RECT) : $RECT; }