ManChesTer
Click on the link in my signature and find ReZoR’s Tool Avast! External Control (AEC).
Run it and select General Tweeker and follow the example.
Perhaps the function NIM_MODIFY do not work sometimes…
This is a solution (in delphi, ca be traduct without problem) :
(c)ManChesTer.
var Nicon : TnotifyIconData;
Function Put_Icon_On_Tray(IconName:String) : Boolean;
begin
Result:=true;
if not (Nicon.hicon<>0) then // if icon handle is nil
Nicon.hicon:=LoadIcon(HInstance, Pchar(IconName)); // load icon from resource
if Nicon.hicon=0 then // if still not loaded
begin
Nicon.hicon:=LoadIcon(HInstance, Pchar(‘ERROR_ICON’)); // load error icon
Result:=false;
end;
Shell_notifyicon(NIM_delete,@Nicon); // delete old icon if already on the tray…
Application.Processmessages; // process all messages !!! important for some windows versions
If not Shell_notifyicon(NIM_Add,@Nicon) then // put the new icon on the tray
result:=false;
Application.Processmessages; // process all messages !!! important for some windows versions
end;
Function Remove_Icon_on_Tray:Boolean;
begin
Result:=False;
if Shell_notifyicon(NIM_delete,@Nicon) then // delete old icon if already on the tray…
Result:=True;
Application.Processmessages; // process all messages !!! important for some windows versions
end;
App sample:
If my_app_is_running then
if not Put_Icon_On_Tray(‘My_ICON’) then
showmessage(‘Error Error on resource or notray in this windows’);
else
if not Put_Icon_On_Tray(‘My_NOTWORK_ICON’) then
showmessage(‘Error Error on resource or no valid tray in this windows’);
To remove the icons:
if Remove_Icon_on_Tray then
showmessage(‘Tray Icon removed…’)
else
Showmessage(‘Error when remove Tray icon’);
To modify the icon:
if not Put_Icon_On_Tray(‘New_ICON’) then
showmessage(‘Error Error on resource or no valid tray in this windows’);
But i know exactly when this happend it’s when you have the french .net framework 1.1 instlled , if i remove the last version of .net framework, all work’s well…
Ps : with the sample code in this post this not append, if i do the same with NIM_MODIFY this append on my applications too…