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

I should have given more info about where do I want to use this. Normaly the script only shows one msgbox, but needs to exit for the parent process to continue on (the parent is not Perl). At times it may show several, but the number will always be small.

It's just a "wrapper" to PVCS command line interface used from an editor, form other scripts, from an automated code generation tool etc. And all I want is to show a "done" message and exit so that I do not block the parent. Or myself from getting/checking out/checking in the next file.

Jenda

  • Comment on Re: Re: Show a msgbox and do not wait (Win32)

Replies are listed 'Best First'.
Re: Re: Re: Show a msgbox and do not wait (Win32)
by tachyon (Chancellor) on Feb 19, 2003 at 01:25 UTC

    Win32::Daemon would be one possible solution. Write a short service script that checks a log file, pops a message box if there is text in there, then unlinks the file.

    Then just write to the log file when you want to pop up a message and continue on in your main program. Have the service read the log every X seconds and send any pending messages. Use the fork in the service so the parent can continue 'listening' to the log while the kid(s) hang on the MsgBox(s).

    If you want to get a little more elegant and complex have the service create and listen to a named pipe rather than using a text file for IPC. Win32::Pipe will let you create a named pipe with ease. All the clien has to do is open the pipe like you would open a file using the UNC syntax

    open PIPE, ">\\\\server\\pipe\\MyNamedPipe" or die $! print PIPE $message CLOSE PIPE
    and then print to it and close the pipe.

    Hope this solves your problem.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print