in reply to Using Win32::ChangeNotify
There is no need for threading or forking. The wait() method takes a timeout in milliseconds.
So, set up a Tk->after callback that goes off every say 1/10 of a second and call
my $notifyObj = Win32::ChangeNotify( ... ); my $found = 0; my $abandoned = 0; sub checkNotify( my $rv = $notifyObj->wait( 0 ); $found = 1 if $rv = 1; $abandoned = 1 if $fv = -1; die 'Notify error' unless defined $rv; } $mainWindow->after( 100, \&checkNotify );
See Win32::IPC and Win32::Semaphore for details.
|
|---|