You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hub/powertoys/command-palette/add-top-level-commands-to-your-extension.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,15 @@ So far, you've only added commands to a single page within your extension. You c
15
15
16
16
## Adding the top-level commands
17
17
18
-
To do that, head on over to the `ExtensionNameCommandsProvider.cs` file. This file is where you'll add commands that should be shown at the top-level of the Command Palette. As you can see, there's currently only a single item there:
18
+
To do that, head on over to the `<ExtensionName>CommandsProvider.cs` file. This file is where you'll add commands that should be shown at the top-level of the Command Palette. As you can see, there's currently only a single item there:
Copy file name to clipboardExpand all lines: hub/powertoys/command-palette/adding-commands.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,10 @@ Now that you've created your extension, it's time to add some commands to it.
15
15
16
16
## Add some commands
17
17
18
-
We can start by navigating to the `ExtensionNamePage.cs` file. This file is the [ListPage](./microsoft-commandpalette-extensions-toolkit/listpage.md) that will be displayed when the user selects your extension. In there you should see:
18
+
We can start by navigating to the `<ExtensionName>Page.cs` file. This file is the [ListPage](./microsoft-commandpalette-extensions-toolkit/listpage.md) that will be displayed when the user selects your extension. In there you should see:
An [IInvokableCommand](./microsoft-commandpalette-extensions/iinvokablecommand.md) is a fundamental unit of *do something* in the Command Palette. The [Invoke](./microsoft-commandpalette-extensions/iinvokablecommand.md) method is called when the user selects the command, and it's where you *do something* in your extension. The **Invoke** method returns an **ICommandResult**, which tells the Command Palette what to do after the command has been invoked. This page details what's possible with each type of command result.
15
15
16
-
The toolkit provides a number of helper methods to create command results. These are all static methods on the **CommandResult** class. Calling these methods on their own won't do anything. You must return those objects as the result of a **Invoke** method, for Command Palette to handle them.
16
+
The toolkit provides a number of helper methods to create command results. These are all static methods on the **CommandResult** class. Calling these methods on their own won't do anything. You must return those objects as the result of a **Invoke** method, for Command Palette to handle them.
17
+
18
+
> [!NOTE]
19
+
> There are code examples for the various CommandResult methods listed on this page.
17
20
18
21
<!-- GoToPage currently omitted from these docs, because it's not remotely implemented -->
19
22
@@ -38,7 +41,7 @@ This result takes the user back to the main page of the Command Palette. It will
38
41
39
42
## Dismiss command result
40
43
41
-
This result hides the Command Palette after the action is executed, and takes it back to the home page. On the next launch, the Command Palette will start from the main page with a blank query. This is useful for commands that are one-off actions, or that don't need to keep the Command Palette open.
44
+
This result hides the Command Palette after the action is executed, and takes it back to the home page. On the next launch, the Command Palette will start from the main page with a blank query. This is useful for commands that are one-off actions, or that don't need to keep the Command Palette open.
42
45
43
46
If you don't know what else to use, this should be your default. Ideally, users should come into the palette, find what they need, and be done with it.
44
47
@@ -60,6 +63,9 @@ This is useful for commands that might have destructive actions, or that need to
60
63
61
64
As an example, here's a page with one command for each kind of command result:
62
65
66
+
> [!NOTE]
67
+
> If working from prior section, modify the code below from `CommandResultsPage` to `<ExtensionName>Page`.
Copy file name to clipboardExpand all lines: hub/powertoys/command-palette/creating-an-extension.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Extensions are written in C#. The fastest way to get started writing extensions
15
15
16
16
The form will ask you for the following information:
17
17
18
-
-**ExtensionName**: The name of your extension. This will be used as the name of the project and the name of the class that implements your commands. Make sure it's a valid C# class name - it shouldn't have any spaces or special characters, and should start with a capital letter.
18
+
-**ExtensionName**: The name of your extension. This will be used as the name of the project and the name of the class that implements your commands. Make sure it's a valid C# class name - it shouldn't have any spaces or special characters, and should start with a capital letter. Reference in docs as `<ExtensionName>`.
19
19
-**Extension Display Name**: The name of your extension as it will appear in the Command Palette. This can be a more human-readable name.
20
20
-**Output Path**: The folder where the project will be created.
21
21
- The project will be created in a subdirectory of the path you provided.
@@ -26,38 +26,38 @@ The form will ask you for the following information:
26
26
Once you submit the form, Command Palette will automatically generate the project for you. At this point, your projects structure should look like the following:
27
27
28
28
```plaintext
29
-
ExtensionName/
29
+
<ExtensionName>/
30
30
│ Directory.Build.props
31
31
│ Directory.Packages.props
32
32
│ nuget.config
33
-
│ ExtensionName.sln
34
-
└───ExtensionName
33
+
│ <ExtensionName>.sln
34
+
└───<ExtensionName>
35
35
│ app.manifest
36
36
│ Package.appxmanifest
37
37
│ Program.cs
38
-
│ ExtensionName.cs
39
-
│ ExtensionName.csproj
40
-
│ ExtensionNameCommandsProvider.cs
38
+
│ <ExtensionName>.cs
39
+
│ <ExtensionName>.csproj
40
+
│ <ExtensionName>CommandsProvider.cs
41
41
├───Assets
42
42
│ <A bunch of placeholder images>
43
43
├───Pages
44
-
│ ExtensionNamePage.cs
44
+
│ <ExtensionName>Page.cs
45
45
└───Properties
46
46
│ launchSettings.json
47
47
└───PublishProfiles
48
48
win-arm64.pubxml
49
49
win-x64.pubxml
50
50
```
51
51
52
-
(with `ExtensionName` replaced with the name you provided)
52
+
(with `<ExtensionName>` replaced with the name you provided)
53
53
54
-
From here, you can immediately build the project and run it. Once your package is deployed and running, Command Palette will automatically discover your extension and load it into the palette.
54
+
From here, you can immediately build the project and run it. Once your package is deployed and running, Command Palette will automatically discover your extension and load it into the palette.
55
55
56
56
> [!TIP]
57
57
> Make sure you _deploy_ your app! Just **build**ing your application won't update the package in the same way that deploying it will.
58
58
59
59
> [!WARNING]
60
-
> Running "ExtensionName (Unpackaged)" from Visual Studio will not **deploy** your app package.
60
+
> Running "\<ExtensionName\> (Unpackaged)" from Visual Studio will not **deploy** your app package.
61
61
>
62
62
> If you're using `git` for source control, and you used the standard `.gitignore` file for C#, you'll want to remove the following two lines from your `.gitignore` file:
63
63
> ```
@@ -74,6 +74,9 @@ Congrats! You've made your first extension! Now let's go ahead and actually add
74
74
75
75
When you make changes to your extension, you can rebuild your project and deploy it again. Command Palette will **not** notice changes to packages that are re-ran through Visual Studio, so you'll need to manually run the "**Reload**" command to force Command Palette to re-instantiate your extension.
76
76
77
+

78
+
79
+
77
80
### Next up: [Add commands to your extension](adding-commands.md)
Copy file name to clipboardExpand all lines: hub/powertoys/command-palette/update-a-list-of-commands.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ So far we've shown how to return a list of static items in your extension. Howev
15
15
16
16
## Updating a command
17
17
18
-
Almost all extension objects in the Command Palette implement the **IPropChanged** interface. This allows them to notify the Command Palette when they've changed, and the Command Palette will update the UI to reflect those changes. If you're using the toolkit implementations, this interface has already been implemented for you for properties that support it.
18
+
Almost all extension objects in the Command Palette implement the **IPropChanged** interface. This allows them to notify the Command Palette when they've changed, and the Command Palette will update the UI to reflect those changes. If you're using the [toolkit](/windows/powertoys/command-palette/microsoft-commandpalette-extensions-toolkit/microsoft-commandpalette-extensions-toolkit) implementations, this interface has already been implemented for you for properties that support it.
19
19
20
20
As a simple example, you can update the title of the page. To do this, you can add a command which will simply update the title of the page.
21
21
@@ -87,36 +87,36 @@ Update your list item to take a reference to the page, and add a method to incre
@@ -128,20 +128,24 @@ Now, every time you perform one of the **IncrementingListItem** commands, the li
128
128
129
129
Everything so far has been pretty instantaneous. Many extensions however may need to do some work that takes a lot longer. In that case, you can set **Page.IsLoading** to `true` to show a loading spinner. This will help indicate that the extension is doing something in the background.
130
130
131
+
> [!NOTE]
132
+
> If working from prior section, modify the code below from `Page.IsLoading` to `this.IsLoading`.
Best practice is to set **IsLoading** to `true` before starting the work. Then do all the work to build all the new **ListItems** you need to display to the user. Then, once the items are ready, call **RaiseItemsChanged** and set **IsLoading** back to `false`. This will ensure that the loading spinner is shown for the entire duration of the work, and that the UI is updated as soon as the work is done (without waiting for your extension to construct new **ListItem** objects).
146
150
147
151
### Next up: [Add top-level commands to your extension](add-top-level-commands-to-your-extension.md)
Copy file name to clipboardExpand all lines: hub/powertoys/run.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -430,6 +430,8 @@ To search for Windows services, [enable the plugin](#plugin-manager), open Power
430
430
431
431
With the Window Walker plugin, you can switch to other windows, close them, or kill the window process.
432
432
433
+
You can enter the **Direct activation command**`<` to search for open windows. The plugin will search for the window title and the name of the process that owns the window.
434
+
433
435
#### Kill a window process
434
436
435
437
With the Window Walker plugin, you can kill the process of a window if it stops responding.
0 commit comments