Find the dialog box and kill it. For example, if you want to automatically kill a window called a calculator title, the following script should work.
use strict;
use warnings;
use Win32::GUI();
use constant WM_CLOSE => 16;
sub kill {
my $handle = Win32::GUI::FindWindow('', 'Calculator');
Win32::GUI::SendMessage($handle, WM_CLOSE, 0, 0);
}
while(1){
&kill;
sleep(5);
}
source
share