Leser: 2
9 Einträge, 1 Seite |
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
#!/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);
sub systray_RightClick {
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",
);
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;
}
">> Starten" => "Systray_start",
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
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);
}
...
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;
}
9 Einträge, 1 Seite |