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

It seems like you are using Win32::MsgBox to report a tracing log instead of for error conditions, etc. I picture the user having to click on 100 pop-up messages after your program ends (or do you really show only one message box per run?). Perhaps instead you could have a side window with a scrolling text box and append your messages there as the program runs.
  • Comment on Re: Show a msgbox and do not wait (Win32)

Replies are listed 'Best First'.
Re: Re: Show a msgbox and do not wait (Win32)
by Jenda (Abbot) on Feb 19, 2003 at 00:43 UTC

    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

      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