Как поместить иконку в Tray
Автор: Nomadic
function TaskBarAddIcon(hWindow: THandle; ID: Cardinal;
ICON: hicon; CallbackMessage: Cardinal; Tip: string): Boolean;
var
NID: TNotifyIconData;
begin
FillChar(NID, SizeOf(TNotifyIconData), 0);
with NID do
begin
cbSize := SizeOf(TNotifyIconData);
Wnd := hWindow;
uID := ID;
uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
uCallbackMessage := CallbackMessage;
hIcon := Icon;
if Length(Tip) > 63 then
SetLength(Tip, 63);
StrPCopy(szTip, Tip);
end;
Result := Shell_NotifyIcon(NIM_ADD, @NID);
end;
|
|