Recent

Author Topic: [SOLVED] SysTraIcon events do not work.  (Read 737 times)

SWM1

  • New Member
  • *
  • Posts: 21
[SOLVED] SysTraIcon events do not work.
« on: March 23, 2023, 09:07:23 am »
SysTraIcon events do not work. :o I need to distinguish which mouse key is pressed when clicking on my SysTrayIcon, but not a single event on the SysTrayIcon works. Does anyone have any ideas how to overcome this? Thanks in advance for any help! The menu works, but equally with the right and left mouse button.
PopUpMenuTray.OnPopUp does not work either.  %)
« Last Edit: March 23, 2023, 02:47:39 pm by SWM1 »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: SysTraIcon events do not work.
« Reply #1 on: March 23, 2023, 09:40:31 am »
Lazarus 2.3.0 (rev 0d507a4009) FPC 3.2.2 x86_64-win64-win32/win64
Tested under MS Windows 10, 64bit built, no problems, everything works like it should.

What OS / FPC / Lazarus versions you are using?
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: SysTraIcon events do not work.
« Reply #2 on: March 23, 2023, 09:47:20 am »
Attached a minimal demo.
Open project and assign some icon/image to the TTrayIcon component, compile and run.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

SWM1

  • New Member
  • *
  • Posts: 21
Re: SysTraIcon events do not work.
« Reply #3 on: March 23, 2023, 09:47:28 am »
Thank you! I have Lazarus 2.2.6. And the Linux Mint 21.1 system. I tried to look at the text of the component - it seems that everything is correct, but for some reason it does not work. Unlike a simple pop-up menu.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: SysTraIcon events do not work.
« Reply #4 on: March 23, 2023, 09:55:27 am »
Please test my demo and tell if it works like it should.
It should tell what button pressed on a label and only on right click open menu and menu just have one executable entry called exit what close the app.
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

SWM1

  • New Member
  • *
  • Posts: 21
Re: SysTraIcon events do not work.
« Reply #5 on: March 23, 2023, 09:56:17 am »
Attached a minimal demo.
Open project and assign some icon/image to the TTrayIcon component, compile and run.

 Tried - it doesn't work for me. Ignores events.   :'(

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2007
  • Fifty shades of code.
    • Delphi & FreePascal
Re: SysTraIcon events do not work.
« Reply #6 on: March 23, 2023, 10:05:50 am »
For *nix there are some remarks noted here, since I am on Windows I can not help further  :(
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

SWM1

  • New Member
  • *
  • Posts: 21
Re: SysTraIcon events do not work.
« Reply #7 on: March 23, 2023, 10:18:11 am »
Thank you!

SWM1

  • New Member
  • *
  • Posts: 21
Re: SysTraIcon events do not work.
« Reply #8 on: March 23, 2023, 02:40:47 pm »
I realized that you can't do anything here! This is a limitation for Linux that cannot be overcome.
Thanks again for the link!

 

TinyPortal © 2005-2018