in reply to Show a msgbox and do not wait (Win32)
Here is the workaround code I came up with:
Main file:
use Win32::Process; Win32::Process::Create($ProcessObj, "C:\\perl\\bin\\perl.exe", qq[perl -MWin32 -e "Win32::MsgBox('Test')"], 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); Win32::Process::Create($ProcessObj, "C:\\perl\\bin\\perl.exe", "perl messagebox.pl", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); for (1..60) { print "$_\n"; sleep(1); }
And if you really want to know how to directly call the MessageBox API from Perl, here's messagebox.pl
--Solouse Win32::API::Prototype; # von die infamous Dave Roth ApiLink( 'user32.dll', 'DWORD MessageBox( DWORD hwnd, LPTSTR lpText, LPTSTR lpCaptio +n, DWORD wType)' ) || die; $lpText = NewString("The text in the message box."); $lpCaption = NewString("The Caption"); MessageBox(0,$lpText,$lpCaption,0);
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
|
|---|