Thread Task-Icon-Menu ohne Funktion? (8 answers)
Opened by xiconfjs at 2006-05-17 12:08

xiconfjs
 2006-05-17 14:31
#45464 #45464
User since
2006-01-21
79 Artikel
BenutzerIn
[Homepage] [default_avatar]
Jo...thx, hat geklappt...hier noch mal zur Vollständigkeit der Quelltext:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/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;
}

View full thread Task-Icon-Menu ohne Funktion?