cruelty has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've just written a small tool that polls for new e-mail on a POP3 mail server. When new mail is found it sends out an SMS to my cellphone. I would like to enhance this by running this as a service in Windows. It would be great if I could get a small icon on the bottom right hand side of the screen between other icons where I could let the user configure the tool. Is there anywhere I could find more information about programming such tools ? Even if I could get some info about how to do this in C++ would be already a great help. Thanks, Mario.

Replies are listed 'Best First'.
Re: Windows NT Service
by thatguy (Parson) on Sep 13, 2001 at 15:12 UTC
    for daemons look at Win32::Daemon or check out the AS docs

    As for the tray icon, perhaps Win32::GUI and this (taken from the mailing list}

    my $icon = new Win32::GUI::Icon("tool.ico"); $trayicon = $Window->AddNotifyIcon(-name => "TrayIcon", -id=>1 +,-icon => $icon, -tip => "$title");

    -p
Re: Windows NT Service
by Graham (Deacon) on Sep 13, 2001 at 16:08 UTC
    You may want to check out this node - 105691 - for information on running perl as a background process under NT


    If you have the WindowsNT Resource Kit you can use a program called srvany.exe to run perl scripts as an NT service.

Re: Windows NT Service
by RayRay459 (Pilgrim) on Sep 13, 2001 at 20:28 UTC
    Cruelty
    This is not a very perlish answer, but i have created scripts that run as services with a program called srvany.exe. Its on the Resource Kit CD. YOu can find some examples of code on MSDN. I know that there are some modules that may do the trick, namely: Win32::Daemon. I have not used it yet, but i think i may try it out soon. Good luck and happy hunting.
    Ray
Re: Windows NT Service
by Rex(Wrecks) (Curate) on Sep 13, 2001 at 21:08 UTC
    Once again, there is always the perl dev kit from active state that has a tool to turn perl script into services. It is not free though :(

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!