In several scripts I use Win32::MsgBox() to display a short message to the user. This works fine even for scripts that do not have a console (are run by wperl.exe). The problem is that the scripts stop executing until the user clicks the OK. I would need the script to continue and even end no matter whether the msgbox is still displayed. (This means that using threads would not be enough.)

I thought about starting a separate script that would just display the message and end when the user clicks OK. But this takes up a lot of memory. So I tried to create such an app in C# (just came from a training). That was even worse! And in VB ... slightly better but still huge. I failed doing this in plain old C. (I've never been a C programmer.)

The best I can do at the moment is to send the currently logged user a message via Win32::Message/system("net send ...").

Does anyone have a better idea? Or knows of a "tiny utility" that would call the MessageBoxA() Win32 API function with the caption and message I give it? No need to get the result, no need to show any other buttons but the OK, etc ...

Thanks, Jenda


In reply to Show a msgbox and do not wait (Win32) by Jenda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.