Geoffrey, j., The problem is not that the program is running as a service, but that the Win32::GUI::Dialog() function *DOES NOT RETURN* until told to do so... Minor problem for a service :).
Geoff, you are right about Win32::GUI::DoEvents()! DoEvents() runs a single cycle of messages off the windows message stack, and then returns control to the calling routine. This can be used to nicely tell the message stack "Hey, I've got like 5 seconds, make it quick" versus "Yo, message stack, what up" and chatting for an hour. I've used it in the past as a method to "demi-thread" and application (an IRC-type administrative bot) for socket communication and GUI control. Ok, so if the message stack gets VERY VERY LONG it might choke the service a bit, and if the service is performing some ridiculously heavy task, the menu isnt going to respond at all, but DoEvents is your function of choice without going into threading and message passing. (Which doesnt sound hard... but its not the worlds prettiest site in Win32::GUI, even if it does work nicely [THX ROB ;)]) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Geoffrey Spear Sent: Wednesday, June 20, 2007 8:40 AM To: [EMAIL PROTECTED] Cc: perl-win32-gui-users@lists.sourceforge.net Subject: Re: [perl-win32-gui-users] Service with Trayicon and Popup-menu I'm not exactly clear on how you go about adding a tray icon with a Win32::Daemon since, if I understand correctly, the daemon runs in the background before a user is even logged in (which I'd assume is also the reason the daemon can't call Win32::GUI::Dialog). Is it possible to call Win32::GUI::DoEvents() in your daemon when it's needed and stop the loop that's calling it when your daemon is going back to acting like a daemon? Or would it make sense (it does to me, but then I'm a UNIX person by background) to have a completely separate process that handles user interaction with the daemon, which itself just runs in the background with no UI of its own? Geoffrey On 6/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I've written a small windows-application with Win32::Daemon and added with Win32::GUI a trayicon. > It works fine and I can see the trayicon. > > But now I want to add a popupmenu to the trayicon which doesn't appear. > Only if I call "Win32::GUI::Dialog();" the dialogboxes are shown, but the service can't run with Dialog(). > > What can I do? > > thx > j. > > -- > Psssst! Schon vom neuen GMX MultiMessenger gehört? > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Geoffrey Spear http://www.geoffreyspear.com/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.9.1/854 - Release Date: 6/19/2007 1:12 PM