Einzelnen Beitrag anzeigen

Benutzerbild von mika
mika

Registriert seit: 25. Okt 2002
176 Beiträge
 
Delphi 6 Professional
 
#18

Re: Systray-Icon in eigener Klasse

  Alt 7. Jun 2005, 15:50
Ich fass sowas auch nciht bös auf

So nu aber nochmal zur Problematik

Delphi-Quellcode:
Procedure TSystrayIcon.MessageHandler(Var Msg: TMessage);
Var
  ptCursor: Tpoint;

Begin
  if Msg.Msg = FTaskbarEvent then
  begin
    If Msg.LParam = WM_RBUTTONDOWN then
    begin
      GetCursorPos(ptCursor);
      if Assigned(FPopupMenu) then
        FPopupMenu.Popup(ptCursor.X, ptCursor.Y);
    end
    else If Msg.LParam = WM_LBUTTONDOWN then
    begin
      MessageBox(Application.Handle, 'Test', 'test', MB_OK)
    end;
  end
  else if Msg.Msg = FTaskbarCreated then
  begin
    AddIconToSysTray(FTrayDescription);
  end;
End;
Er geht in die Prozedur wenn ich auf irgendein(!) Icon in dem Systray klicke, mein Problem
ist halt bloss das in Msg.Msg immer 28 drinsteht, egal ob ich auf mein Icon oder das von
der Lautstärkeregelung von Windows klicke.... Ergo ist (Msg.Msg = FTaskbarevent) nie TRUE
:: don't Panic ::
  Mit Zitat antworten Zitat