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

a "tiny utility" that would call the MessageBoxA() Win32 API function with the caption and message I give it?

See rundll32.exe to do that. Is a "standard" MS app and you can find details on it's use on their web site.

Another method would be to create a "regular" window (i.e. not a dialog) that does what you want. In VB you just show a form with a label & and OK button in it, and set the label's value to your string. You can set various properties of the form at design time to simulate a dialog box. Change your compile settings to start the app with a "main" function instead of a form. Otherwise, the application will just exit when the form is dismissed. Sorry, I don't do GUI programming with perl, so i can't give you a perl-centric answer.

  • 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 15:30 UTC

    Thanks for the ideas. I forgot about rundll32, thanks. It wount work though anyway. Rundll32 supports only functions with prototype

    void CALLBACK EntryPoint(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdSh +ow);
    and MessageBoxA is too different.

    I've tried the VB way, with Sub Main and MsgBox function, but the resulting EXE wasted about 4MB of memory when run.

    Jenda

      Code it in Delphi to avoid the large overhead. It's way better than VB anyway.

      However, you might also consider exploring windows scripting host.

        I'd have to stea^B^B^B^Bbuy it first ;-) I plan to look into Delphi for five years already. I always liked the Pascal style syntax better than C style. Though maybe now that I've got used to curlies .... I don't think I'll ever have the time/need to though :-( Besides, my employer want's us to use C# :-{

        I don't think the result would be smaller (not the EXE, the memory footprint!) than BrowserUk's popup.exe anyway.

        Thanks, Jenda

        P.S.: Another languages I'd like to play a little with are Dylan and Erlang. I think especialy Erlang could be a good tool to have in ones toolset.