in reply to Show a msgbox and do not wait (Win32)

Creating another process is (I think) the only way this is possible without creating a full-blown dialog or window--the messagebox API is inherently modal, methinks.

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

use 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);
--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.