Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Tray Icon POP3 / IMAP Client with Win32::GUI

by djw (Vicar)
on Feb 27, 2002 at 15:43 UTC ( #147935=note: print w/ replies, xml ) Need Help??


in reply to Tray Icon POP3 / IMAP Client with Win32::GUI

This is really cool! I gave it a go and I really like how it works so far. Some neat features to add would be a right click menu on the taskbar icon for things like "Check Mail", "Exit", "Read Messages", and "Send Mail" (if you add that ability).

I know that you probably use the DOS window for debugging etc, but you may want to include a way to kill that when running your program. I found a quick way to do this somewhere (sorry I don't remember, this isn't mine) - basically create a file called 'start.pl' and use this snippet of code:

use Win32; use Win32::Process; Win32::Process::Create($Win32::Process::Create::ProcessObj, 'C:/perl/bin/perl.exe', 'perl traymail.pl', 0, DETACHED_PROCESS, ".") or die print_error(); sub print_error() { return Win32::FormatMessage(Win32::GetLastError() ); }

You could probably clean that up a lot (like checking for perl install path etc), but it will do the trick for most default installations. But you need a way to exit your program before you add this =) (I tried it and it worked, I just had to kill perl.exe in the task manager to exit your application).

Just for fun, I also tried Perl2exe on traymail using the '-gui' option and that works as well (you need the registered version of Perl2exe to use the -gui option I beleive). To exit, I just killed the 'traymail.exe' app in task manager.

Keep up the cool work LupoX! ++

djw


Comment on Re: Tray Icon POP3 / IMAP Client with Win32::GUI
Download Code
Re: Re: Tray Icon POP3 / IMAP Client with Win32::GUI
by LupoX (Pilgrim) on Feb 27, 2002 at 21:15 UTC

    Hi DJW!

    Thanks for your comment!!!!

    The right click menu is not there because I use mouse events for all needed actions:

  • Right mouse for opening the GUI
  • Left Mouse nothing
  • Left doubleclick to check mails
  • Middle mouse doubleclick for exit the programm
  • But you are right! The will be a lot of people who would like a right mouse click menu. Would you like to code one?

    Second point the DOS box: THANK You thats a great idea!! I`ve tried it and it worked very fine...I do not have to kill perl.exe because of my middle mouse doubleclick exit.

    Another great THANK YOU for you perl2exe trick. I tried it some time ago and was very dissapointed that it did not work. Never read about "-gui" and also I did not have the full version. But I think I`ll buy it now....

    Have a good time all you perl hackers....

    And DJW: Do you want to write some code for Traymail?

    LupoX is greeting you...

(bbfu) (hide DOS window) Re2: Tray Icon POP3 / IMAP Client with Win32::GUI
by bbfu (Curate) on Mar 12, 2002 at 00:53 UTC

    Here is another way to hide the DOS window, though it requires modifying the perl executable (or a copy thereof), so it's more something the user of the program can do, rather than something the author of the program can do.

    bbfu
    Seasons don't fear The Reaper.
    Nor do the wind, the sun, and the rain.
    We can be like they are.

      Actually you don't even have to do that. ActivePerl comes with wperl.exe, which is the perl interpreter as a no-console executable.

      /J

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://147935]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-10-21 22:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls