procedure Taskbar_on(Icontitle :
string);
procedure Taskbar_off;
procedure TaskbarEvent(
var Msg: TMessage);
Message WM_TASKABAREVENT;
...
procedure Taskbar_on (Icontitle :
String);
var NotifyIconData: TNotifyIconData;
a : integer;
begin
Fillchar(NotifyIconData,Sizeof(NotifyIconData),0);
NotifyIconData.cbSize := Sizeof(NotifyIconData);
NotifyIconData.Wnd :=
Handle;
NotifyIconData.uFlags := NIF_MESSAGE
or NIF_ICON
or NIF_TIP;
NotifyIconData.uCallbackMessage := WM_TASKABAREVENT;
NotifyIconData.hIcon := Application.Icon.Handle;
for a := 0
to 63
do
NotifyIconData.szTip[a] := IconTitle[a+1];
//warum hab ich das denn gemacht? :gruebel:
Shell_NotifyIcon(NIM_ADD, @NotifyIconData);
end;
procedure Taskbar_off;
var NotifyIconData : TNotifyIconData;
begin
FillChar(NotifyIconData,Sizeof(NotifyIconData),0);
NotifyIconData.cbSize := Sizeof(NotifyIconData);
NotifyIconData.Wnd := self.Handle;
NotifyIconData.uFlags := NIF_MESSAGE
or NIF_ICON
or NIF_TIP;
NotifyIconData.uCallbackMessage := WM_TASKABAREVENT;
NotifyIconData.hIcon := Application.Icon.Handle;
NotifyIconData.szTip := '
Punkt';
Shell_NotifyIcon(NIM_DELETE, @NotifyIconData);
end;
procedure TForm1.TaskbarEvent(
var Msg: TMessage);
begin
if Msg.LParam = wm_LButtonDblClk
then begin
Application.restore;
Application.bringtofront;
Form1.activate;
end;
if Msg.LParam = wm_RButtonDown
then popupmenu1.popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);
end;