#!perl use threads; use Win32::GUI qw( WM_CLOSE WM_TIMER ); $CHILD = threads->create('child', ''); $WinMain = Win32::GUI::Window->new( -name => 'Main', -text => 'Task Test', -width => 300, -height => 200, -onTerminate => \&Main_Terminate, -onTimer => \&DoTimer, ); $WinMain->Show(); Win32::GUI::Dialog(); $CHILD->detach(); sub Main_Terminate { -1; } sub child { sleep 1; # Give parent time to create window my $parent = Win32::GUI::FindWindow('','Task Test'); Win32::GUI::SendMessage($parent,WM_TIMER,0,0); threads->exit(0); } sub DoTimer { print "Timer fired\n"; return 0; }