Jump to content
Steve Maughan

TNotification — Customizing Caption on Windows 10?

Recommended Posts

I've added a TNotification to my application. After it completes a relatively computationally intensive task it creates and displays the notification using the following code:

  	//-- Create it
    xNotification := NotificationCenter.CreateNotification;

    try

      //-- Process if assigned
      if assigned(xNotification) then
      begin
        xNotification.Name := 'Optimizer';
        xNotification.Title := 'AlignMix AI Optimizer';
        xNotification.AlertBody := IntToStr(OptScope.TerritoryCount) + ' '
          + Project.Alignment.Territory.TerritoryNamePlural
        	+ ' created in ' + FormatFloat('#,##0.0', StopWatch.ElapsedMilliseconds / 1000) + ' seconds';
        NotificationCenter.PresentNotification(xNotification);
      end;

    finally
      xNotification.Free;
    end;

However, when the EXE is run for the first time outside the IDE the notification has a rather odd caption "Embarcadero.DesktopToasts.02911170" (see image attached). On subsequent runs it has the executable name, minus the ".exe" extension (see image attached).

 

How can I customize the notification caption? I'd like it to simply say "AlignMix"

 

Thanks,

 

Steve 

n1.png

n2.png

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×