use Win32::GuiTest qw(FindWindowLike GetWindowText GetWindow SetForegroundWindow SendKeys SendMouse MouseMoveAbsPix GetDesktopWindow WMGetText GetChildWindows); my $rhapsodyHandle = GetWindowHandle("Rhapsody"); sub GetWindowHandle{ my($windowName) = @_; my @windows = FindWindowLike(0, "^$windowName", ""); my $matchingWindow; for (@windows) { if($_){ my @children = GetChildWindows($_); for my $child (@children) { my $text = GetWindowText($child); next if ($text =~ /^\xff/); # you've found the icon next if ($text =~ /^OK|Cancel|Abort|Retry|Ignore|Yes|No$/); # you've found a button print "Found child $child with text '$text'\n"; } } } return $matchingWindow; } #### Found child 264196 with text 'track_label.bitmap' Found child 264198 with text 'album.text' Found child 264200 with text 'artist.text' Found child 264202 with text 'song.text' Found child 198996 with text 'buffering.text' Found child 198990 with text 'playlist_title.text' Found child 198992 with text 'info_album.button'