Powerbuilder 11.5 rebuild message clicker

Are you used to that message ? A full rebuild is required to be compatible with the source code. Do the build now? Do you want to you project finish to be rebuild by itself without your action ?

So I provide a small perl script that do the work in background.

Script MsgClicker.pl

#!/usr/bin/perl -w
use Win32::GuiTest qw( :FUNC :VK );
sub strnow{
  my @now = localtime;
  return sprintf "%04d-%02d-%02d %02d:%02d:%02d",1900 + $now[5], 1+$now[4], $now[3], $now[2], $now[1], $now[0];
}
$waitmsg = "Wait for messagebox...\n";
$title = "Warning";
$msg = "A full rebuild is required to be compatible with the source code. Do the build now?";
$| = 1;  #Autoflush
print $waitmsg;
while(1){
  for my $parent (WaitWindowLike(undef, $title, "#32770")) {
    for (GetChildWindows($parent)){
      if(GetWindowText($_) =~ /$msg/){
        print strnow . " - Found messagebox( '$title', '$msg'), pushing 'Yes' button...\n";
        PushChildButton($parent,"Yes");
        print $waitmsg;
        sleep(1);
      }
    }
  }  
}

And for those who don’t (have|want) a compiler to build dependence Win32::GuiTest, nor a Perl interpreter, I provide an all-in-one executable, see attachments (requiered a 7z extractor).

Attachments