Tom
Tom

Reputation: 6707

Converting Shell_NotifyIcon Balloon Tips to TNotificationCenter

I am upgrading my widget and planning if I should convert NotifyIcon Balloon Tips to TNotificationCenter notifications. How the following code can be replaced with TNotificationCenter? Is there support in Delphi 2007 for TNotificationCenter?

And what would be the benefit to do this conversion, is it possible to e.g. configure tip to remain a bit longer on screen with TNotificationCenter API? NotifyIcon API TimeOut does not seem to work anymore.

procedure TForm1.Button4Click(Sender: TObject);
begin
  if ( boIconAdded ) then begin
    StrPLCopy(nidIconData.szInfo, Memo1.Text, 255);
    StrPLCopy(nidIconData.szInfoTitle, Edit2.Text, 63);
    nidIconData.uFlags := NIF_INFO;
    if ( Shell_NotifyIcon(NIM_MODIFY, @nidIconData) ) then
      Memo2.Lines.Add('Balloon tip sent.')
    else
      Memo2.Lines.Add('Failed to send balloon tip.');
  end;
end;

Upvotes: 0

Views: 69

Answers (0)

Related Questions