Skip to content

Commit cb63a9e

Browse files
committed
Resolve markdown linter suggestions and update toc
1 parent 2145c46 commit cb63a9e

File tree

2 files changed

+81
-80
lines changed

2 files changed

+81
-80
lines changed
Lines changed: 80 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,115 @@
11
---
22
title: Launch Snipping Tool
33
description: This topic describes how to use the new protocol launch framework for Snipping Tool. Your app can use these URI schemes to launch the Snipping Tool capture overlay to create a new snip or recording.
4-
5-
ms.date: 01/30/2025
4+
ms.date: 02/14/2025
65
ms.topic: concept-article
76
keywords: windows 11, uri, snipping tool, capture
87
ms.localizationpriority: medium
98
ms.custom: RS5
109
# customer-intent: As a Windows developer, I want to learn about the ms-screenclip URI scheme so that I can integrate it into my application to programmatically launch the Snipping Tool. This will allow my application to trigger a snip experience directly, enabling users to take screenshots seamlessly without manually opening the Snipping Tool.
1110
---
11+
1212
# Launch Snipping Tool
1313

14-
This article specifies the protocol for integrating first and third-party applications with the Windows Snipping Tool using the **ms-clip:** URI (Uniform Resource Identifier) scheme. The protocol facilitates the capture of images and video with audio via the Snipping Tool. App callers can customize and choose which Snipping Tool features their app will display. The protocol is designed to offer flexibility, security, and ease of use, aligning closely with familiar HTTP-based interactions. This shift can make the protocol more intuitive for developers and facilitate its integration with web technologies.
14+
This article specifies the protocol for integrating first and third-party applications with the Windows Snipping Tool using the **ms-clip:** URI (Uniform Resource Identifier) scheme. The protocol facilitates the capture of images and video with audio via the Snipping Tool. App callers can customize and choose which Snipping Tool features their app will display. The protocol is designed to offer flexibility, security, and ease of use, aligning closely with familiar HTTP-based interactions. This shift can make the protocol more intuitive for developers and facilitate its integration with web technologies.
1515

1616
> [!NOTE]
1717
> This protocol launch replaces the previous existing experience documented [here](launch-screen-snipping.md).
1818
19-
## Supported Features include:
19+
## Supported features
2020

21-
* Rectangle Capture
22-
* Freeform Capture
23-
* Window Capture
24-
* Ability to launch directly into a Snip or Recording
25-
* Customizing features available
26-
* Autosave feature is available, but can be disabled
21+
The Snipping Tool protocol supports the following features:
2722

23+
- Rectangle Capture
24+
- Freeform Capture
25+
- Window Capture
26+
- Ability to launch directly into a Snip or Recording
27+
- Customizing features available
28+
- Autosave feature is available, but can be disabled
2829

2930
## Protocol Specification
3031

31-
**URI Scheme:** {scheme}://{host}/{path}?{query}
32+
**URI Scheme:** `{scheme}://{host}/{path}?{query}`
3233

3334
**ms-screenclip:** takes the following parameters:
3435

35-
* **Scheme:** ms-screenclip - The custom scheme for the Snipping Tool protocol.
36-
* **Host:** Specifies the type of capture, e.g. capture, annotate.
37-
* **Path:** The media type being captured or annotated. /image, /video, /audio.
38-
* **Query:** Parameters for the specified schema
36+
- **Scheme:** `ms-screenclip` - The custom scheme for the Snipping Tool protocol.
37+
- **Host:** Specifies the type of capture, e.g. capture, annotate.
38+
- **Path:** The media type being captured or annotated. /image, /video, /audio.
39+
- **Query:** Parameters for the specified schema.
3940

4041
## Host (required)
41-
* Capture
42+
43+
- Capture
4244

4345
## Path (required)
44-
* Image
45-
* Video
4646

47-
## EnabledModes Parameter
47+
- Image
48+
- Video
4849

49-
The enabledModes parameter is designed to give developers granular control over the available UI options when invoking the ms-screenclip protocol. This allows for a tailored user experience that matches the specific requirements of the calling application. By specifying the enabledModes parameter, developers can restrict the user's choices in the Snipping Tool UI to ensure the output format meets their expectations.
50+
## EnabledModes parameter
5051

51-
> [!NOTE]
52-
> The FullScreenSnip mode is not supported in interactive mode at this time and should not be included in the enabledModes parameter.
52+
The enabledModes parameter is designed to give developers granular control over the available UI options when invoking the ms-screenclip protocol. This allows for a tailored user experience that matches the specific requirements of the calling application. By specifying the enabledModes parameter, developers can restrict the user's choices in the Snipping Tool UI to ensure the output format meets their expectations.
5353

54+
> [!NOTE]
55+
> The FullScreenSnip mode is not supported in interactive mode at this time and should not be included in the enabledModes parameter.
5456
55-
## Supported Modes
57+
## Supported modes
5658

57-
The **enabledModes** parameter can accept the following modes:
59+
The **enabledModes** parameter can accept the following modes:
5860

59-
**RectangleSnip:** Enables rectangle capture mode.
60-
**WindowSnip:** Enables window capture mode.
61-
**FreeformSnip:** Enables freeform capture mode.
62-
**RectangleRecord:** Enables rectangle recording mode.
63-
**RecordAllModes:** Enables all recording modes (currently only RectangleRecord is available).
64-
**SnippingAllModes:** Enables all snipping (image capture) modes (RectangleSnip, WindowSnip, FreeformSnip).
65-
**All:** Enables all supported modes (RectangleSnip, WindowSnip, FreeformSnip, RectangleRecord).
61+
- **RectangleSnip:** Enables rectangle capture mode.
62+
- **WindowSnip:** Enables window capture mode.
63+
- **FreeformSnip:** Enables freeform capture mode.
64+
- **RectangleRecord:** Enables rectangle recording mode.
65+
- **RecordAllModes:** Enables all recording modes (currently only RectangleRecord is available).
66+
- **SnippingAllModes:** Enables all snipping (image capture) modes (RectangleSnip, WindowSnip, FreeformSnip).
67+
- **All:** Enables all supported modes (RectangleSnip, WindowSnip, FreeformSnip, RectangleRecord).
6668

6769
> [!IMPORTANT]
6870
> If no **enabledModes** parameter is specified, the default behavior will allow all modes.
6971
7072
## Examples
7173

72-
**Example 1: Enable Only Rectangle Snip **
74+
### Example 1: Enable Only Rectangle Snip
7375

74-
ms-screenclip://capture/image?rectangle&enabledModes=RectangleSnip&redirect-uri=my-snip-protocol-test-app://response
75-
76+
ms-screenclip://capture/image?rectangle&enabledModes=RectangleSnip&redirect-uri=my-snip-protocol-test-app://response
7677

77-
*Explanation: This command launches the Snipping Tool with only the rectangle snipping option enabled. The user will only be able to select a rectangular region for capture.*
78+
*Explanation: This command launches the Snipping Tool with only the rectangle snipping option enabled. The user will only be able to select a rectangular region for capture.*
7879

79-
**Example 2: Enable Rectangle Snip and Window Snip**
80+
### Example 2: Enable Rectangle Snip and Window Snip
8081

81-
ms-screenclip://capture/image?rectangle&enabledModes=RectangleSnip,WindowSnip&redirect-uri=my-snip-protocol-test-app://response
82-
82+
ms-screenclip://capture/image?rectangle&enabledModes=RectangleSnip,WindowSnip&redirect-uri=my-snip-protocol-test-app://response
8383

84-
*Explanation: This command launches the Snipping Tool with both the rectangle and window snipping modes enabled. The user can choose between capturing a rectangular area or an entire window.*
84+
*Explanation: This command launches the Snipping Tool with both the rectangle and window snipping modes enabled. The user can choose between capturing a rectangular area or an entire window.*
8585

86-
**Example 3: Enable All Snipping Modes**
86+
### Example 3: Enable All Snipping Modes
8787

88-
ms-screenclip://capture/image?rectangle&enabledModes=SnippingAllModes&redirect-uri=my-snip-protocol-test-app://response
89-
88+
ms-screenclip://capture/image?rectangle&enabledModes=SnippingAllModes&redirect-uri=my-snip-protocol-test-app://response
9089

9190
*Explanation: This command launches the Snipping Tool with all supported image snipping modes (RectangleSnip, WindowSnip, FreeformSnip). The FullScreenSnip mode is excluded from interactive mode and will not be enabled.*
9291

93-
**Example 4: Enable Recording Mode Only**
92+
### Example 4: Enable Recording Mode Only
9493

95-
ms-screenclip://capture/video?enabledModes=RecordAllModes&redirect-uri=my-snip-protocol-test-app://response
96-
94+
ms-screenclip://capture/video?enabledModes=RecordAllModes&redirect-uri=my-snip-protocol-test-app://response
9795

9896
*Explanation: This command launches the Snipping Tool with only the recording mode enabled. The user can only choose the rectangle recording mode.*
9997

100-
**Example 5: Enable Multiple Snipping and Recording Modes**
98+
### Example 5: Enable Multiple Snipping and Recording Modes
10199

102-
ms-screenclip://capture/image?enabledModes=RectangleSnip,RectangleRecord&redirect-uri=my-snip-protocol-test-app://response
103-
100+
ms-screenclip://capture/image?enabledModes=RectangleSnip,RectangleRecord&redirect-uri=my-snip-protocol-test-app://response
104101

105102
*Explanation: This command launches the Snipping Tool with both rectangle snip and rectangle recording modes available. Users can either snip a rectangle or record the selected area.*
106103

107-
## Key Considerations
108-
109-
* **Mode Restrictions:** Developers should ensure that enabling specific modes aligns with the expected behavior of their application. Restricting UI options helps maintain a consistent user experience and ensures the resulting capture matches the application's needs.
104+
## Key considerations
110105

111-
* **Unsupported Modes:** The FullScreenSnip mode is not supported in interactive mode and should not be used in the enabledModes parameter.
112-
113-
* **Default Behavior:** If no enabledModes parameter is specified, all modes (RectangleSnip, WindowSnip, FreeformSnip, RectangleRecord) are available by default.
106+
- **Mode Restrictions:** Developers should ensure that enabling specific modes aligns with the expected behavior of their application. Restricting UI options helps maintain a consistent user experience and ensures the resulting capture matches the application's needs.
107+
- **Unsupported Modes:** The FullScreenSnip mode is not supported in interactive mode and should not be used in the enabledModes parameter.
108+
- **Default Behavior:** If no enabledModes parameter is specified, all modes (RectangleSnip, WindowSnip, FreeformSnip, RectangleRecord) are available by default.
114109

115110
## Query
116111

117-
**ms-screenclip:**
112+
**ms-screenclip:**
118113

119114
| Parameter | Type | Required | Description | Default |
120115
|--------------------------|-----------------|----------|-----------------------------------------------------------------------------|-------------------|
@@ -127,27 +122,31 @@ ms-screenclip://capture/image?enabledModes=RectangleSnip,RectangleRecord&redirec
127122
| FullScreen | (Image) | no | Captures the full screen snip. | Auto Mode |
128123
| redirect-uri | URI | yes | Callback URI protocol for the response. Applications must register a handler for this protocol. | n/a |
129124

125+
## Parameter validation
130126

131-
## Parameter Validation
127+
The following validation checks should be performed on the parameters:
132128

133-
**Parameter Sanitization:** Validate and sanitize all input parameters to prevent injection attacks.
134-
**Protocol Validation:** Ensure that the callback protocol string is validated against a list of allowed protocols to prevent injections or execution of malicious code.
135-
**Required Fields:** Check that all required fields are provided and valid before proceeding with the snip operation.
129+
- **Parameter Sanitization:** Validate and sanitize all input parameters to prevent injection attacks.
130+
- **Protocol Validation:** Ensure that the callback protocol string is validated against a list of allowed protocols to prevent injections or execution of malicious code.
131+
- **Required Fields:** Check that all required fields are provided and valid before proceeding with the snip operation.
136132

137-
Response if expected parameters **aren't** supplied or overloaded
133+
Response if expected parameters **aren't** supplied or overloaded.
138134

139-
## Responses to the Caller
135+
## Responses to the caller
140136

141137
To ensure the response back to the caller via `redirect-uri` follows HTTP-based interaction principles, the response will mimic the structure of an HTTP response but will be conveyed through URI query parameters. This approach keeps the interaction web-standard compliant and familiar to developers.
142138

143-
**Use of shared tokens**
144-
The use of the `SharedStorageAccessManager` class and of sharing tokens is subject to the following requirements and restrictions.
139+
### Use of shared tokens
140+
141+
The use of the `SharedStorageAccessManager` class and of sharing tokens is subject to the following requirements and restrictions:
142+
143+
- A sharing token can only be redeemed one time. After that, the token is no longer valid.
144+
- A sharing token expires after 14 days and is no longer valid.
145+
- The source app cannot provide more than one thousand sharing tokens. After a token is redeemed, removed, or expires, however, it no longer counts against the quota of the source app.
145146

146-
* A sharing token can only be redeemed one time. After that, the token is no longer valid.
147-
* A sharing token expires after 14 days and is no longer valid.
148-
*The source app cannot provide more than one thousand sharing tokens. After a token is redeemed, removed, or expires, however, it no longer counts against the quota of the source app.
147+
### Response parameters
149148

150-
## Response
149+
The following parameters are returned in the redirect URI:
151150

152151
| Parameter | Type | Description |
153152
|-------------------------|--------|------------------------------------------------------------------------------------------------------------------|
@@ -158,11 +157,13 @@ The use of the `SharedStorageAccessManager` class and of sharing tokens is subje
158157

159158
## Retrieving a token
160159

161-
I have developed a sample application to test the process of calling the protocol and converting the response token into media. Use the [SharedStorageAccessManager] (/uwp/api/windows.applicationmodel.datatransfer.sharedstorageaccessmanager) library to obtain the token.
160+
A sample application is available to test the process of calling the protocol and converting the response token into media. Use the [SharedStorageAccessManager](/uwp/api/windows.applicationmodel.datatransfer.sharedstorageaccessmanager) library to obtain the token.
162161

163-
[Sample app code for retrieving tokens ](https://microsoft.visualstudio.com/Apps/_git/SnipProtocolTestApp?path=/SnipProtocolTestApp/MainPage.xaml.cs&version=GBmaster&line=139&lineEnd=140&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents)
162+
The sample app code for retrieving tokens is available [here](https://microsoft.visualstudio.com/Apps/_git/SnipProtocolTestApp?path=/SnipProtocolTestApp/MainPage.xaml.cs&version=GBmaster&line=139&lineEnd=140&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents).
164163

165-
## Status/code
164+
## Status codes
165+
166+
The following table lists the status codes that can be returned in the redirect URI:
166167

167168
| HTTP Status Code | Reason | Description |
168169
|------------------|------------------------------------------------|-----------------------------------------------------------------------------|
@@ -171,23 +172,24 @@ I have developed a sample application to test the process of calling the protoco
171172
| 408 | Request Timeout - Operation Took Too Long | The operation timed out before completion. |
172173
| 499 | Client Closed Request - User Cancelled the Snip| The user cancelled the snip, closing the request. |
173174
| 500 | Internal Server Error - Processing Failed | An error occurred on the server, preventing completion. |
174-
175175

176-
## Example Responses
176+
## Example responses
177177

178178
| Use Case | Full URI Example |
179179
|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
180-
| Successful Capture | my-snip-protocol-test-app://response/?code=200&reason=Success&request-correlation-id=CF99C5A5-3907-461E-A9A9-D8AAFFAD5031&token=8930-ASDFA-ASDF4545 |
181-
| Failed Capture | my-snip-protocol-test-app://response/?code=400&reason=Bad%20Request%20-%20Invalid%20value%20Missing%20Parameters&request-correlation-id=C7696B38-52C8-419A-880F-F3350D7A6626 |
182-
180+
| Successful Capture | `my-snip-protocol-test-app://response/?code=200&reason=Success&request-correlation-id=CF99C5A5-3907-461E-A9A9-D8AAFFAD5031&token=8930-ASDFA-ASDF4545` |
181+
| Failed Capture | `my-snip-protocol-test-app://response/?code=400&reason=Bad%20Request%20-%20Invalid%20value%20Missing%20Parameters&request-correlation-id=C7696B38-52C8-419A-880F-F3350D7A6626` |
183182

184-
## Caller Example
183+
## Caller example
185184

186-
Below is a table displaying examples of full URIs constructed to initiate different types of snipping sessions using the screenclip: protocol. Each URI example demonstrates a combination of parameters to illustrate how you can customize the snipping tool's behavior for different use cases.
185+
Below is a table displaying examples of full URIs constructed to initiate different types of snipping sessions using the screenclip: protocol. Each URI example demonstrates a combination of parameters to illustrate how you can customize the snipping tool's behavior for different use cases.
187186

188187
| Use Case | Example URI | Description |
189188
|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
190189
| Rectangle Mode - Interactive | ms-screenclip://capture/image?user-agent=TestApp&Rectangle&uri=my-snip-protocol-test-app://response | An application initiates an interactive rectangle capture session, where the user selects the capture area. The result is redirected to a specific URI. |
191-
| Video Mode - Interactive | ms-screenclip://capture/video?api-version=1.0&user-agent=TestApp&redirect-uri=my-snip-protocol-test-app://response | A video capture. Always in rectangle mode.
190+
| Video Mode - Interactive | ms-screenclip://capture/video?api-version=1.0&user-agent=TestApp&redirect-uri=my-snip-protocol-test-app://response | A video capture. Always in rectangle mode. |
192191

192+
## Related content
193193

194+
- [Use Snipping Tool to capture screenshots](https://support.microsoft.com/windows/use-snipping-tool-to-capture-screenshots-00246869-1843-655f-f220-97299b865f6b)
195+
- [Launch screen snipping (Legacy)](launch-screen-snipping.md)

hub/apps/toc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ items:
209209
- name: Launch the Windows Maps app
210210
href: develop/launch/launch-maps-app.md
211211
- name: Launch Snipping Tool
212+
href: develop/launch/launch-snipping-tool.md
212213
- items:
213-
- name: Launch Snipping Tool
214-
href: develop/launch/launch-snipping-tool.md
215214
- name: Launch screen snipping (legacy)
216215
href: develop/launch/launch-screen-snipping.md
217216
- name: Launch the People app

0 commit comments

Comments
 (0)