I'm trying to help kickstart this mailing list so... here's another helpful fix:
 
Handles change, titles/text are often wrong or undefined or missing, and generally the only fairly consistent thing you can use to find a control is an ID.  Unfortunately since most of Win32::GuiTest's subroutines require a control handle, I realize a FindHandle($id) method was needed.  So:
 
sub MatchId {
    my $wnd = shift;
    my $regex = shift;
    my $title = GetWindowText($wnd);
    my $id = GetWindowID($wnd);
    return $regex == $id; # Return only precise ID matches.
}
 
sub FindHandle {
   # Returns the handle of the first occurrence of an ID in all children of current window.
   my $id        = shift;
   my $parent    = shift || GetForegroundWindow();
   my $is_string = shift;
 
   #print "Finding handle for $id";
 
   foreach my $child (GetChildWindows($parent)) {
       my $childtext = GetWindowText($child);
       my $childid   = GetWindowID($child);
       # Is correct text or correct window ID?
       if (MatchId($child, $id)) {
           #print "Handle is $child\n";
           return($child);
           last;
       }
   }
}
 
It's working OK so far... I think there may be a bug where the $child that gets returned is actually the parent - I saw it happen once but couldn't reproduce it and it's been bothering me ever since.  I'm sure it will reappear at a critical time.  :)
 
Erik