Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Hiding Windows Programs

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

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'.
(tye)Re: Hiding Windows Programs
by tye (Sage) on Mar 26, 2001 at 04: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 jorg (Friar) on Mar 26, 2001 at 02: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
Re: Hiding Windows Programs
by diskcrash (Hermit) on Mar 26, 2001 at 10: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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 13:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found