Link to home
Create AccountLog in
Delphi

Delphi

--

Questions

--

Followers

Top Experts

Avatar of data-nova
data-nova

Refresh System Tray
Hi,

 How can I refresh the System Tray through a delphi program.
 Can it be done by some API ?
 All i want is that the System Tray is redrawn so that if there are some icons that belong to "closed" programs then those icons should vanish

 Thanks

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


ASKER CERTIFIED SOLUTION
Avatar of Eddie ShipmanEddie Shipman🇺🇸

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

SOLUTION
Avatar of ZhaawZZhaawZ🇱🇻

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.

Avatar of Eddie ShipmanEddie Shipman🇺🇸

Zhaawz,
  That is exactly what my posted example does:
  "{ Sweep the mouse cursor over each icon in the tray in both dimensions }"

Avatar of ZhaawZZhaawZ🇱🇻

EddieShipman, it's not exactly the same. The difference is that you move cursor by using SetCursorPos(), but I don't move it. I'm just sending wm_mousemove messages to tray so that it thinks that user moves a cursor.

Avatar of Amir AzhdariAmir Azhdari🇺🇸

procedure TForm1.Button1Click(Sender: TObject);
begin
PostThreadMessage(GetWindowThreadProcessID(FindWindow('Progman','Program Manager'),nil),WM_QUIT,0,0);
shellexecute(application.Handle,'open','explorer.exe',0,'',SW_SHOWNORMAL      );
end;

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of data-novadata-nova

ASKER


 thanks for your help guys :)

OK, I see it now, thatnks for the correction.

Avatar of ZhaawZZhaawZ🇱🇻

Btw, I don't think that it's good idea to move cursor (mainly because of visual defekts ;)

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.

Delphi

Delphi

--

Questions

--

Followers

Top Experts

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.