in reply to System Tray Icon Disappears

I have a perl application that presents an icon in the system tray ... Can anybody help me out here?

How are you creating this from the perl code ?

perlmonks RegisterWindowMessage, RegisterWindowMessage, RegisterWindowMessage, taskbar, taskbar, tray, tray,

Re: Win32: Get COM object (for IE in this case) from HWND, Win32::TSA::Notify, https://metacpan.org/pod/distribution/Win32-GUI/samples/NotifyIcon.pl, Win32::GUI::Tutorial::Part4, Win32::SysTray,

Replies are listed 'Best First'.
Re^2: System Tray Icon Disappears
by vaguy (Initiate) on Mar 12, 2014 at 13:46 UTC
    I'm using Active Perl with Tk and Win32::GUI().
    Calls are to Win32::GUI::Window->new and then to AddNotifyIcon.
    Code looks like this:
    sub SetupSystray{ $TrayIcon = new Win32::GUI::Icon('WebCam.ico'); $TrayWinHidden = Win32::GUI::Window->new( -name => 'TrayWindow', -text => 'TrayWindow', -width => 20, -height => 20, -visible => 0, ); $TrayNotify = $TrayWinHidden->AddNotifyIcon( -name => "WebCam-App", -icon => $TrayIcon, -tip => "WebCam", -balloon_icon => "info", -onRightClick => \&TrackTrayMenu, -onClick => \&ToggleProgWindow, ); $TrayMenu = Win32::GUI::Menu->new( "" => "Options", ">WebCam" => {-name => "WebCam"}, ">-" => 0, ">Open/Close" => {-name => "ToggleProg", -onClick => \&To +ggleProgWindow,-default => 1}, ">-" => 0, ">Exit" => {-name => "Exit",-onClick => \&CloseDownFrom +Tray} ) or prtFTL "Failed to create Tray Menu $!"; } sub CloseDownFromTray{ $mw->destroy; }