#!/usr/bin/perl use Win32::GUI; use strict; use warnings; my $id = 1; my $hwnd = GUI::GetPerlWindow(); GUI::Hide($hwnd); my $icon = new Win32::GUI::Icon('an.ico'); my $main = Win32::GUI::Window->new( -name => 'Main', -text => 'Perl', -width => 200, -height => 200, ); my $ni = $main->AddNotifyIcon( -name => "systray", -id => $id, -icon => $icon, -tip => "Go Back!up", ); #Win32::GUI::Dialog(); #Win32::GUI::Show($hwnd); my $systray_menu = new Win32::GUI::Menu( "SystrayMenu Functions" => "SystrayMenu", #"Go Back!up", "> Info" => "Systray_info", "> Dienst" =>"", ">> Starten" => "Systray_start", ">> Stoppen" => "Systray_stop", ">> Restart" => "Systray_restart", ">> Pausieren" => "Systray_pause", "> Exit" => "SystrayExit", ); Win32::GUI::Dialog(); Win32::GUI::Show($hwnd); sub systray_RightClick { my($x, $y) = Win32::GUI::GetCursorPos(); $main->TrackPopupMenu($systray_menu->{SystrayMenu}, $x, $y-50); } sub Main_Terminate { Win32::GUI::NotifyIcon::Delete( $ni, -id => $id ); return -1; } sub systray_Terminate { Win32::GUI::NotifyIcon::Delete( $ni, -id => $id ); return -1; } sub Systray_start_Click{ print "\a \n"; exit; }