Subscribing to Event Notifications using ADLX

ADLX has an event notification mechanism specific to each ADLX domain, but the event notification in all the domains use the same approach.

The application implements a listener interface as defined in the ADLX SDK. An instance of the listener interface is passed to ADLX to register for notification when the respective settings are changed.

When a change occurs, ADLX calls the method in this listener instance and passes the new settings as parameters.

When events notifications are no longer required by the application, the application unregisters the listener instance from ADLX, and the instance of the listener interface can be destroyed by the application.

Example: The Desktop domain provides notifications when there is a change to the desktop list.

Use the ADLX event notification management functionality when programming a new application, or when programming an existing application that uses ADL. The mechanism remains the same for all the programming languages, but there are language-specific differences in implementation.

You can program an application to get notified about changes such as when desktops are:

  • Created

  • Removed

  • Changed – Size settings

  • Changed – Location settings

To program an application to receive desktop list change notification,

  1. Implement, and then create an instance of the implemented IADLXDesktopListChangedListener interface.

    Note: The ADLX Desktop List Changed Listener instance is passed to ADLX and must exist for the entire duration of the application’s desktop list changed event registration.

  2. Call IADLXSystem::GetDesktopServices in the ADLX System interface.

    Result: Gets the IADLXDesktopServices interface.

  3. Call IADLXDesktopServices::GetDesktopChangedHandling in the ADLX Desktop Services interface.

    Result: Gets the IADLXDesktopChangedHandling interface.

  4. Pass the ADLX Desktop List Changed Listener instance as the parameter into IADLXDesktopChangedHandling::AddDesktopListEventListener .

    Note: When a change to the desktop occurs, the OnDesktopListChanged is called into the ADLX Desktop List Changed Listener instance, with the new desktop list as the IADLXDesktopList parameter.

To unsubscribe the Desktop List Changed notification:

  1. Unregister the ADLX Desktop List Changed Listener instance from ADLX using RemoveDesktopListEventListener .

  2. Discard the desktop list changed listener instance after the registration is removed.

    Note: Other ADLX domains that support event subscription use the same mechanism for event notifications.

For more information, for C++ see Receiving Events Notifications C++ samples .

For C see Receiving Events Notifications C samples .

For C# see DisplayEvents C# samples .

For Java see DisplayEvents Java samples .

For Python see DisplayEvents Python samples .

Related pages

  • Visit the Adlx product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!