Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
go ahead... be a heretic
 
PerlMonks  

Hiding Windows Programs

by dmckee (Scribe)
on Mar 25, 2001 at 18:15 UTC ( [id://67049]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

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

It's hardly Perl related, but I don't know who else to ask: is there any way of hiding a Perl application (ie: it doesn't appear on the toolbar - maybe in the system tray?) and having it responding to Windows events (such as a shutdown procedure?) If anyone can point me in the right direction, I'd be very grateful.

Dave

Eight years involved with the nuclear industry have taught me that when nothing can possible go wrong and every avenue has been covered, then is the time to buy a house on the next continent. Terry Pratchett

Replies are listed 'Best First'.
Re: Hiding Windows Programs
by jorg (Friar) on Mar 25, 2001 at 21:50 UTC
    I once wrote an windows (mfc) application that minimized to the system tray. There are a few MFC classes around that offer this functionality, have a look on developer.com you should be able to source some stuff there.
    Maybe you could do a shell call to your perl program and let the MFC classes handle the windows side of things.
    I haven't used Perl TK stuff yet, this could possibly allow you the same functionality as MFC. Maybe some other monks with TK experience can help you out here..

    Jorg

    "Do or do not, there is no try" -- Yoda
(tye)Re: Hiding Windows Programs
by tye (Sage) on Mar 25, 2001 at 23:40 UTC

    I think the easiest thing might be to use Win32::Process and use the CREATE_NO_WINDOW option. Though I haven't tried that so there might be some gotchas to that.

            - tye (but my friends call me "Tye")
Re: Hiding Windows Programs
by diskcrash (Hermit) on Mar 26, 2001 at 05:40 UTC

    When I install Perl scripts as NT services, the only place they appear is in the NT Services dialog box. There are references around about "installing perl scripts as an NT service".

    See the comments by Kevin Meltzer in www.tpj.com on this topic. Its easy. You need to get copies of srvany and instsrv to install the script. You must also edit the NT Registry.

    Diskcrash

      You can also use Win32::Daemon from roth.net. If you go this route (rather than srvany) then you can actually get the script to do something while it shuts down. I.e. if you stop the service - your script will realise that you are stopping the service and you can do something like close a db connection gracefully or whatever.

      $ perldoc perldoc

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://67049]
Approved by root
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.