Thema: Delphi Baloon-Hint im TrayIcon

Einzelnen Beitrag anzeigen

k4ni

Registriert seit: 17. Jul 2007
Ort: Ulm
258 Beiträge
 
Delphi 7 Enterprise
 
#1

Baloon-Hint im TrayIcon

  Alt 23. Mär 2008, 17:56
Hey,

Also ich versuche gerade mit einem Hint komponenten ein Baloon-Hint auf ein Tray-Icon zu machen bzw. anzeigen zu lassen.
Also in etwa so wie da:
http://www.delphipraxis.net/internal...ht=ballon+tray

Also so ruft man den hint normalerweise auf:
Delphi-Quellcode:
        Hint.ShowTextHintBalloon(bmtInfo, 'How is the test?',
      'WHOA! Am i looking frightnng for you? :)',
      300, 10, 10, self, TALHintBalloonArrowPosition(1));
Also self ist so zu sagen das "handle". Ich könnte da jetzt auch Button1 oder so rein machen.
So nun will ich das aber auf mein TrayIcon klatschen, nur bekomm das nicht hin.
Der Hint will ein TControl als handle.

Hier zeig ich euch mal wie ich das TrayIcon erstell:
Delphi-Quellcode:
  ...
WM_ICONTRAY = WM_USER + 1; // bei mir global
TrayIconData: TNotifyIconData; // auch global

procedure TForm1.FormCreate(...)
begin
  with TrayIconData do
  begin
    cbSize := SizeOf(TrayIconData);
    Wnd := Handle;
    uID := 0;
    uFlags := NIF_MESSAGE + NIF_ICON + NIF_TIP;
    uCallbackMessage := WM_ICONTRAY;
    hIcon := Application.Icon.Handle;
    StrPCopy(szTip, Application.Title);

      ShowWindow( Application.Handle, SW_HIDE );
  SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                 WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
  ShowWindow( Application.Handle, SW_SHOW );
  end;

  Shell_NotifyIcon(NIM_ADD, @TrayIconData);
...
end;
Nun wenn ich aber WM_ICONTRAY oder TrayIconData als TControl-handle beim Hint component benütze geht es natürlich nicht.
Irgend ne idee wie ich das machen könnte?
  Mit Zitat antworten Zitat