Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
procedure RemoveStaleTrayIcons;
var Hwnd : THandle;
X,Y : Integer;
begin
try
// find handle of toolbar
Hwnd := FindWindow('Shell_TrayWnd', '');
if Hwnd = 0 then
Exit;
Hwnd := FindWindowEx(Hwnd, 0, 'TrayNotifyWnd', nil);
if Hwnd = 0 then
Exit;
Hwnd := FindWindowEx(Hwnd, 0, 'SysPager', nil);
if Hwnd = 0 then
Exit;
Hwnd := FindWindowEx(Hwnd, 0, 'ToolbarWindow32', nil);
// some mouse_movemessages over each trayicon will trigger their windowproc,
// if the windowproc does not reply to the callback, the icon is automatically deleted
if Hwnd <> 0 then
begin
Y := 1;
while Y < 50 do
begin
X := 1;
while X < 400 do
begin
Inc(X, 16);
PostMessage(Hwnd, WM_MOUSEMOVE, 0, Y * $10000 + X);
end;
Inc(Y, 16);
end;
end;
except
// do nothing, this is best effort
end;
end;
maybe a challenge for you (and our forum members):create a reusable component from your code?
Delphi 2009 has a built in TTrayIcon, ive been looking at it on my mates pc.
played around with the component. for some reason the ballon tip does not work (on XP SP3). is it working at your side?