Hi leute,
Ich habe nen kleines prog gemacht, das alle paar Minuten was bestimmtes machen soll, wenn es aktiv ist.
Dieses prog ist immer minimiert im Tray und würde gerne den Tray text @ laufzeit ändern.
Sollte ca. so sein (im Tray Text):
blabla programm - Status: Aktiv
blabla programm - Status: Inaktiv
Habe für tray icon einen fertigen code genommen:
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:
| Procedure TForm1.ApplicationMinimize(Sender: TObject); var NotifyIconData: TNotifyIconData; Owner : HWnd; 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; NotifyIconData.szTip := 'blabla programm - Status:'; Shell_NotifyIcon(NIM_ADD, @NotifyIconData);
Owner:=GetWindow(Handle,GW_OWNER); ShowWindow(Owner,SW_HIDE); end;
Procedure TForm1.ApplicationMaximize(Sender: TObject); 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; |
das ist der code indem der Tray Text steht:
Delphi-Quelltext
1:
| NotifyIconData.szTip := 'blabla programm - Status:'; |
wie kann ich das per laufzeit ändern?
danke für hilfe!
Moderiert von
Tino: Topic aus VCL (Visual Component Library) verschoben am Mo 30.04.2007 um 20:30