I invented a workaround.
I create another hidden window, attach timer to it, and in timer check $main->Text - if it's empty string or undef, then window has been closed from other process.
Thanks for your attention!
Comment on Re: Win32::GUI - how to catch WM_CLOSE sent from other process?