Integrate Taskbar Corner Customizer into your application

This guide will take you through the process of integrating Taskbar Corner Customizer into your application.

Download Files

When your order has been completed, you are able to download the file necessary. You will also receive an email with the links.

The zip contains the following files:

  • NtApiDotNet.dll (3rd party library used by our solution)
  • TaskbarCornerCustomizer.Main.exe
  • TaskbarCornerCustomizer.Shared.dll
  • TaskbarCornerCustomizer.SP.exe
  • TaskbarCornerCustomizer.ST.exe

Add Files to Your Project

All of the files in the downloaded zip are needed to make changes to tray icon visibility. This means that all of those files must be included in the software you distribute, installed and run on the Windows end-point. Furthermore, these files needs to be located in the same path.

Create License File

When your order has completed, you will automatically receive your license key by email:

  • Copy the license key. Make sure to select everything in between the two ‘COPY’ lines.
  • Create a new text file called TaskbarCornerCustomizer.License.txt, in the same location as the other downloaded files.
  • Paste the license text into this file.

The folder should now contain the following files:

  • NtApiDotNet.dll
  • TaskbarCornerCustomizer.Main.exe
  • TaskbarCornerCustomizer.Shared.dll
  • TaskbarCornerCustomizer.SP.exe
  • TaskbarCornerCustomizer.ST.exe
  • TaskbarCornerCustomizer.License.txt

Implement in your code

This code must run either as local administrator (in user context) or as local system (NT AUTHORITY\SYSTEM)

This code must also run when the user (for which we want change the tray icon visibility) is logged on.

You can use Taskbar Corner Customizer in all application types. If your application is built with .NET you can use our .NET Standard 2.0 library.

.NET Applications

The following .NET versions are supported by this library:

  • .NET 5.0
  • .NET Framework 4.7.2 and later
  • .NET Core 2.0 and later

For other versions please use the method described in the ‘Other Applications‘ section.

  • Create a folder in your project called TCC (or whatever you’d like) and add the files described in previous sections.
  • Select all 6 files, right-click and select Properties. Change the Copy to output directory setting to Copy if newer.
  • Add a project reference to the TaskbarCornerCustomizer.Shared.dll file.
  • Create an instance of TrayManager and pass the correct folder path to the constructor.
var tccFolderPath = Path.Combine(
   Path.GetDirectoryName(
       Assembly.GetExecutingAssembly().Location), "TCC");

var trayManager = new TrayManager(folderPath: tccFolderPath);
  • Get all currently logged on user SIDs and pass it to the SetConfig method together with a dictionary containing the tray icon process name of your application and the visibility state desired.
var usersSids = trayManager.GetCurrentlyLoggedOnUsersSids().ToList();

foreach (var userSid in usersSids)
{
  trayManager.SetConfig(userSid, new Dictionary<string, TrayIconState>()
  { 
    { "MyApp.exe", TrayIconState.Visible } 
  });
}
  • Good practice is to dispose TrayManager when your application exits.
public void Dispose()
{
  trayManager?.Dispose()
}
  • There is also an optional method in TrayManager called WatchLoggedOnUsers, which takes a callback delegate LoggedOnUsersChangedCallback(List<string> usersSids). This callback is then invoked whenever the currently logged on users change.
trayManager.WatchLoggedOnUsers(UpdateTrayIcons);

void UpdateTrayIcons(List<string> usersSids = null)
{
   //Update tray icon here
}

Other Applications

  • Execute TaskbarCornerCustomizer.exe with the following arguments (in this exact order):
    • -p <TrayIconProcessName> (Your tray icon process named as specified in your order)
    • -s <State> (The visibility state you want to set it to: Visible or Hidden.)
    • -u <UserSID> (Optional, SID for a currently logged on user for which we would like to set tray icons visibility. If this is not specified, the tray icon visibility will be configured for all currently logged on users.)
  • All of the files described in sections above must be present in the same folder as TaskbarCornerCustomizer.exe.
  • The process must be started with local administrator rights or as local system.

Command Line Example

"C:\Program Files\MyApp\TCC\TaskbarCornerCustomizer.exe" -p MyApp.exe -s Visible

with user SID:

"C:\Program Files\MyApp\TCC\TaskbarCornerCustomizer.exe" -p MyApp.exe -s Visible -u S-1-5-21-4080544051-916602977-41484691-1001

PowerShell Example

Start-Process -FilePath "C:\Program Files\MyApp\TCC\TaskbarCornerCustomizer.exe" -ArgumentList "-p MyApp.Exe","-s Visible"

with user SID:

Start-Process -FilePath "C:\Program Files\MyApp\TCC\TaskbarCornerCustomizer.exe" -ArgumentList "-p MyApp.Exe","-s Visible","-u S-1-5-21-4080544051-916602977-41484691-1001"

C++ Example

system("C:\\Program Files\\MyApp\\TCC\\TaskbarCornerCustomizer.exe -p MyApp.exe -s Visible");

with user SID:

system("C:\\Program Files\\MyApp\\TCC\\TaskbarCornerCustomizer.exe -p MyApp.exe -s Visible -u S-1-5-21-4080544051-916602977-41484691-1001");