|
1 | 1 | ---
|
2 | 2 | title: Command Palette Extensibility
|
3 | 3 | description: The Command Palette provides a full extension model, allowing developers to create their own experiences for the palette. Find info about how to create an extension and publish it along with samples.
|
4 |
| -ms.date: 2/3/2025 |
| 4 | +ms.date: 2/28/2025 |
5 | 5 | ms.topic: concept-article
|
6 | 6 | no-loc: [PowerToys, Windows, Insider]
|
7 | 7 | # Customer intent: As a Windows developer, I want to learn how to develop an extension for the Command Palette.
|
8 | 8 | ---
|
9 | 9 |
|
10 |
| -# Extensibility overview |
| 10 | +# Extensibility overview |
| 11 | + |
| 12 | +## Registering your extension |
| 13 | + |
| 14 | +Extensions can register themselves with the Command Palette using their `.appxmanifest`. As an example: |
| 15 | + |
| 16 | +```XML |
| 17 | +<Extensions> |
| 18 | + <com:Extension Category="windows.comServer"> |
| 19 | + <com:ComServer> |
| 20 | + <com:ExeServer Executable="ExtensionName.exe" Arguments="-RegisterProcessAsComServer" DisplayName="Sample Extension"> |
| 21 | + <com:Class Id="<Extension CLSID Here>" DisplayName="Sample Extension" /> |
| 22 | + </com:ExeServer> |
| 23 | + </com:ComServer> |
| 24 | + </com:Extension> |
| 25 | + <uap3:Extension Category="windows.appExtension"> |
| 26 | + <uap3:AppExtension Name="com.microsoft.commandpalette" |
| 27 | + Id="YourApplicationUniqueId" |
| 28 | + PublicFolder="Public" |
| 29 | + DisplayName="Sample Extension" |
| 30 | + Description="Sample Extension for Run"> |
| 31 | + <uap3:Properties> |
| 32 | + <CmdPalProvider> |
| 33 | + <Activation> |
| 34 | + <CreateInstance ClassId="<Extension CLSID Here>" /> |
| 35 | + </Activation> |
| 36 | + <SupportedInterfaces> |
| 37 | + <Commands /> |
| 38 | + </SupportedInterfaces> |
| 39 | + </CmdPalProvider> |
| 40 | + </uap3:Properties> |
| 41 | + </uap3:AppExtension> |
| 42 | + </uap3:Extension> |
| 43 | +</Extensions> |
| 44 | +``` |
| 45 | + |
| 46 | +Notable elements: |
| 47 | + |
| 48 | +- The application must specify a `Extensions.comExtension.ComServer` to host their COM class. This allows for the OS to register that GUID as a COM class we can instantiate. |
| 49 | + |
| 50 | + - Make sure that this CLSID is unique, and matches the one in your application |
| 51 | + |
| 52 | +- The application must specify a `Extensions.uap3Extension.AppExtension` with the Name set to `com.microsoft.commandpalette`. This is the unique identifier which DevPal can use to find it's extensions. |
| 53 | + |
| 54 | +- In the `Properties` of your `AppExtension`, you must specify a `CmdPalProvider` element. This is where you specify the CLSID of the COM class that DevPal will instantiate to interact with your extension. Also, you specify which interfaces you support. |
| 55 | + |
| 56 | +Currently, only `Commands` is supported. If we need to add more in the future, we can add them to the `SupportedInterfaces` element. |
0 commit comments