ich hab ein SysTray Icon mit
Code: Alles auswählen
Shell_NotifyIcon(NIM_Add, @NotifyIconData);
erzeugt. Eigentlich funktioniert diese Code Zeile nicht. Ich übergebe stattdessen eine PNotifyIconDataA Variable. Nun möchte ich auf einen Mausklick in dieses Icon reagieren. Folgenden Code habe ich ähnlich zu Delphi 5 erstellt. Aber mit Lazarus krieg ich immer (0, 0). Wie kriege ich (x, y) mit Lazarus?
Code: Alles auswählen
public
procedure wmUser(var Msg : tMessage); message wm_User;
procedure GetCursorPos(var p : tPoint);
begin
p.X := CursorX;
p.Y := CursorY;
end;
procedure TParamForm.wmUser;
var Point : tPoint;
begin
case Msg.lParam of
wm_rButtonUp,
wm_lButtonUp:
begin
Point.X := 0;
GetCursorPos(Point);
PopupMenu.Popup(Point.X, Point.Y);
end;
end;
end;