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

fork() could be a solution if I were running a Unix. I said I need the script to be able to exit even though the message still sits on the screen. And since fork() creates threads, not processes this will not work. Even if the main thread would end the whole processes will still be alive and the program that started it will wait.

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 00:49 UTC

    Fair enough

    cheers

    tachyon

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

Re: Re: Re: Show a msgbox and do not wait (Win32)
by helgi (Hermit) on Feb 19, 2003 at 11:47 UTC
    Here is one way that appears to fulfill your requirements.

    use Win32::Process; my $user = $ENV{USERNAME}; my $message = "$0 has a message for $user"; send_message($message); sub send_message { my ($message) = @_; my $Process; my $program = 'C:/WINNT/system32/net.exe'; Win32::Process::Create($Process, "$program", "net send $user $message", 0, DETACHED_PROCESS, ".") or die "Create: $!"; }

    --
    Regards,
    Helgi Briem
    helgi AT decode DOT is