Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hub/apps/develop/camera/basic-photo-capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The [**SoftwareBitmap**](/uwp/api/Windows.Graphics.Imaging.SoftwareBitmap) class

Capture a photo to a **SoftwareBitmap** using the [**LowLagPhotoCapture**](/uwp/api/Windows.Media.Capture.LowLagPhotoCapture) class. Get an instance of this class by calling [**PrepareLowLagPhotoCaptureAsync**](/uwp/api/windows.media.capture.mediacapture.preparelowlagphotocaptureasync), passing in an [**ImageEncodingProperties**](/uwp/api/Windows.Media.MediaProperties.ImageEncodingProperties) object specifying the image format you want. [**CreateUncompressed**](/uwp/api/windows.media.mediaproperties.imageencodingproperties.createuncompressed) creates an uncompressed encoding with the specified pixel format. Initiate photo capture by calling [**CaptureAsync**](/uwp/api/windows.media.capture.lowlagphotocapture.captureasync), which returns a [**CapturedPhoto**](/uwp/api/Windows.Media.Capture.CapturedPhoto) object. Get a **SoftwareBitmap** by accessing the [**Frame**](/uwp/api/windows.media.capture.capturedphoto.frame) property and then the [**SoftwareBitmap**](/uwp/api/windows.media.capture.capturedframe.softwarebitmap) property.

You can capture multiple photos by repeatedly calling **CaptureAsync**. When you are done capturing, call [**FinishAsync**](/uwp/api/windows.media.capture.advancedphotocapture.finishasync) to shut down the **LowLagPhotoCapture** session and free up the associated resources. After calling **FinishAsync**, to begin capturing photos again you will need to call [**PrepareLowLagPhotoCaptureAsync**](/uwp/api/windows.media.capture.mediacapture.preparelowlagphotocaptureasync) again to reinitialize the capture session before calling [**CaptureAsync**](/uwp/api/windows.media.capture.lowlagphotocapture.captureasync).
You can capture multiple photos by repeatedly calling **CaptureAsync**. When you are done capturing, call [**FinishAsync**](/uwp/api/windows.media.capture.lowlagphotocapture.finishasync) to shut down the **LowLagPhotoCapture** session and free up the associated resources. After calling **FinishAsync**, to begin capturing photos again you will need to call [**PrepareLowLagPhotoCaptureAsync**](/uwp/api/windows.media.capture.mediacapture.preparelowlagphotocaptureasync) again to reinitialize the capture session before calling [**CaptureAsync**](/uwp/api/windows.media.capture.lowlagphotocapture.captureasync).

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml.cs" id="SnippetCameraLowLagPhotoCapture":::

Expand Down Expand Up @@ -94,7 +94,7 @@ You can quickly add audio capture to your app by using the same technique shown
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml.cs" id="SnippetCameraStartAudioCapture":::


Call [**StopAsync**](/uwp/api/windows.media.capture.lowlagphotosequencecapture.stopasync) to stop the audio recording.
Call [**StopAsync**](/uwp/api/windows.media.capture.lowlagmediarecording.stopasync) to stop the audio recording.

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml.cs" id="SnippetCameraStopAudioCapture":::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This example uses a [**Slider**](/uwp/api/Windows.UI.Xaml.Controls.Slider) contr

:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml" id="SnippetEvXAML":::

Check to see if the current capture device supports the **ExposureCompensationControl** by checking the [Supported](/windows/uwp/audio-video-camera/supported-codecs) property. If the control is supported, you can show and enable the UI for this feature.
Check to see if the current capture device supports the **ExposureCompensationControl** by checking the [Supported](/uwp/api/windows.media.devices.exposurecompensationcontrol.supported) property. If the control is supported, you can show and enable the UI for this feature.

The exposure compensation value must be within the range supported by the device and must be an increment of the supported step size. Get the supported values for the current device by checking the [**Min**](/uwp/api/windows.media.devices.exposurecompensationcontrol.min), [**Max**](/uwp/api/windows.media.devices.exposurecompensationcontrol.max), and [**Step**](/uwp/api/windows.media.devices.exposurecompensationcontrol.step) properties, which are used to set the corresponding properties of the slider control.

Expand All @@ -71,7 +71,7 @@ This example uses a set of radio buttons to allow the user to switch between on,

:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml" id="SnippetFlashXAML":::

Check to see if the current capture device supports the **FlashControl** by checking the [**Supported**](/uwp/api/windows.media.devices.focuscontrol.supported) property. If the control is supported, you can show and enable the UI for this feature. If the **FlashControl** is supported, automatic red eye reduction may or may not be supported, so check the [**RedEyeReductionSupported**](/uwp/api/windows.media.devices.flashcontrol.redeyereductionsupported) property before enabling the UI. Because the **TorchControl** is separate from the flash control, you must also check its [**Supported**](/uwp/api/windows.media.devices.torchcontrol.supported) property before using it.
Check to see if the current capture device supports the **FlashControl** by checking the [**Supported**](/uwp/api/windows.media.devices.flashcontrol.supported) property. If the control is supported, you can show and enable the UI for this feature. If the **FlashControl** is supported, automatic red eye reduction may or may not be supported, so check the [**RedEyeReductionSupported**](/uwp/api/windows.media.devices.flashcontrol.redeyereductionsupported) property before enabling the UI. Because the **TorchControl** is separate from the flash control, you must also check its [**Supported**](/uwp/api/windows.media.devices.torchcontrol.supported) property before using it.

In the [**Checked**](/uwp/api/windows.ui.xaml.controls.primitives.togglebutton.checked) event handler for each of the flash radio buttons, enable or disable the appropriate corresponding flash setting. Note that to set the flash to always be used, you must set the [**Enabled**](/uwp/api/windows.media.devices.flashcontrol.enabled) property to true and the [**Auto**](/uwp/api/windows.media.devices.flashcontrol.auto) property to false.

Expand Down Expand Up @@ -100,7 +100,7 @@ Enabling continuous autofocus instructs the camera to adjust the focus dynamical

:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml" id="SnippetCAFXAML":::

Check to see if the current capture device supports the **FocusControl** by checking the [**Supported**](/uwp/api/windows.media.devices.flashcontrol.supported) property. Next, determine if continuous autofocus is supported by checking the [**SupportedFocusModes**](/uwp/api/windows.media.devices.focuscontrol.supportedfocusmodes) list to see if it contains the value [**FocusMode.Continuous**](/uwp/api/Windows.Media.Devices.FocusMode), and if so, show the continuous autofocus radio button.
Check to see if the current capture device supports the **FocusControl** by checking the [**Supported**](/uwp/api/windows.media.devices.focuscontrol.supported) property. Next, determine if continuous autofocus is supported by checking the [**SupportedFocusModes**](/uwp/api/windows.media.devices.focuscontrol.supportedfocusmodes) list to see if it contains the value [**FocusMode.Continuous**](/uwp/api/Windows.Media.Devices.FocusMode), and if so, show the continuous autofocus radio button.

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetCAF":::

Expand All @@ -121,7 +121,7 @@ This example uses a radio button to enable and disable tap-to-focus mode.

:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.xaml" id="SnippetTapFocusXAML":::

Check to see if the current capture device supports the **FocusControl** by checking the [**Supported**](/uwp/api/windows.media.devices.flashcontrol.supported) property. The **RegionsOfInterestControl** must be supported, and must support at least one region, in order to use this technique. Check the [**AutoFocusSupported**](/uwp/api/windows.media.devices.regionsofinterestcontrol.autofocussupported) and [**MaxRegions**](/uwp/api/windows.media.devices.regionsofinterestcontrol.maxregions) properties to determine whether to show or hide the radio button for tap-to-focus.
Check to see if the current capture device supports the **FocusControl** by checking the [**Supported**](/uwp/api/windows.media.devices.focuscontrol.supported) property. The **RegionsOfInterestControl** must be supported, and must support at least one region, in order to use this technique. Check the [**AutoFocusSupported**](/uwp/api/windows.media.devices.regionsofinterestcontrol.autofocussupported) and [**MaxRegions**](/uwp/api/windows.media.devices.regionsofinterestcontrol.maxregions) properties to determine whether to show or hide the radio button for tap-to-focus.

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetTapFocus":::

Expand Down Expand Up @@ -278,7 +278,7 @@ In the [**SelectionChanged**](/uwp/api/windows.ui.xaml.controls.primitives.selec

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetWhiteBalanceComboBox":::

In the **ValueChanged** event handler, get the current value of the control and the set the white balance value by calling [**SetValueAsync**](/uwp/api/windows.media.devices.exposurecontrol.setvalueasync).
In the **ValueChanged** event handler, get the current value of the control and the set the white balance value by calling [**SetValueAsync**](/uwp/api/windows.media.devices.whitebalancecontrol.setvalueasync).

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetWhiteBalanceSlider":::

Expand Down
24 changes: 12 additions & 12 deletions hub/apps/develop/feeds/implement-feed-provider-win32.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct FeedProvider : winrt::implements<FeedProvider, winrt::Microsoft::Windows:
{
FeedProvider() {}

/* IFeedrovider required functions that need to be implemented */
/* IFeedProvider required functions that need to be implemented */
void OnFeedProviderEnabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedProviderEnabledArgs args);
void OnFeedProviderDisabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedProviderDisabledArgs args);
void OnFeedEnabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedEnabledArgs args);
Expand All @@ -125,7 +125,7 @@ In the next few sections, we'll implement the methods of the **IFeedProvider** i


```cpp
// WidgetProvider.cpp
// FeedProvider.cpp
namespace winrt
{
using namespace Microsoft::Windows::Widgets::Feeds::Providers;
Expand All @@ -137,8 +137,8 @@ namespace winrt

The **OnFeedProviderEnabled** method is invoked when a feed associated with the provider is created by the Widgets Board host. In the implementation of this method, generate a query string with the parameters that will be passed to the URL that provides the feed content, including any necessary authentication tokens. Create an instance of **CustomQueryParametersUpdateOptions**, passing in the **FeedProviderDefinitionId** from the event args that identifies the feed that has been enabled and the query string. Get the default **FeedManager** and call **SetCustomQueryParameters** to register the query string parameters with the Widgets Board.

```csharp
// FeedProvider.cs
```cpp
// FeedProvider.cpp
void FeedProvider::OnFeedProviderEnabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedProviderEnabledArgs args)
{
std::wstringstream wstringstream;
Expand All @@ -155,8 +155,8 @@ wstringstream << args.FeedProviderDefinitionId().c_str() << L" feed provider was

**OnFeedProviderDisabled** is called when the Widgets Board when all of the feeds for this provider have been disabled. Feed providers are not required to perform any actions in response to these this method call. The method invocation can be used for telemetry purposes or to update the query string parameters or revoke authentication tokens, if needed. If the app only supports a single feed provider or if all feed providers supported by the app have been disabled, then the app can exit in response to this callback.

```csharp
// FeedProvider.cs
```cpp
// FeedProvider.cpp

void FeedProvider::OnFeedProviderDisabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedProviderDisabledArgs args)
{
Expand All @@ -170,8 +170,8 @@ void FeedProvider::OnFeedProviderDisabled(winrt::Microsoft::Windows::Widgets::Fe

**OnFeedEnabled** and **OnFeedDisabled** are invoked by the Widgets Board when a feed is enabled or disabled. Feed providers are not required to perform any actions in response to these method calls. The method invocation can be used for telemetry purposes or to update the query string parameters or revoke authentication tokens, if needed.

```csharp
// FeedProvider.cs
```cpp
// FeedProvider.cpp

void FeedProvider::OnFeedEnabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedEnabledArgs args)
{
Expand All @@ -181,8 +181,8 @@ void FeedProvider::OnFeedEnabled(winrt::Microsoft::Windows::Widgets::Feeds::Prov
}
```

```csharp
// FeedProvider.cs
```cpp
// FeedProvider.cpp

void FeedProvider::OnFeedDisabled(winrt::Microsoft::Windows::Widgets::Feeds::Providers::FeedDisabledArgs args)
{
Expand All @@ -196,8 +196,8 @@ void FeedProvider::OnFeedDisabled(winrt::Microsoft::Windows::Widgets::Feeds::Pro

**OnCustomQueryParametersRequested** is raised when the Widgets Board determines that the custom query parameters associated with the feed provider need to be refreshed. For example, this method may be raised if the operation to fetch feed content from the remote web service fails. The **FeedProviderDefinitionId** property of the **CustomQueryParametersRequestedArgs** passed into this method specifies the feed for which query string params are being requested. The provider should regenerate the query string and pass it back to the Widgets Board by calling **SetCustomQueryParameters**.

```csharp
// FeedProvider.cs
```cpp
// FeedProvider.cpp

void FeedProvider::OnCustomQueryParametersRequested(winrt::Microsoft::Windows::Widgets::Feeds::Providers::CustomQueryParametersRequestedArgs args)
{
Expand Down
4 changes: 2 additions & 2 deletions hub/apps/develop/windows-integration/click-to-do.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ The following code samples open Click to Do from the user's app:
### [C#](#tab/csharp)

```csharp
var clickToDoUri = new Windows.Foundation.Uri(L"ms-clicktodo://");
var clickToDoUri = new System.Uri("ms-clicktodo://");

Windows.System.Launcher.LaunchUriAsync(clickToDoUri)
Windows.System.Launcher.LaunchUriAsync(clickToDoUri);
```

### [C++/WinRT](#tab/cpp)
Expand Down
16 changes: 7 additions & 9 deletions hub/apps/develop/windows-integration/copilot-key-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public string State
}
```

Add a **TextBox** control to the UI to show the current activation state of the app. Replace the default **StackPanel** element in MainPage.xaml with the following code.
Add a **TextBlock** control to the UI to show the current activation state of the app. Replace the default **StackPanel** element in MainWindow.xaml with the following code.

```xaml
<!-- MainWindow.xaml -->
Expand All @@ -70,7 +70,7 @@ public MainWindow(string state)
{
this.InitializeComponent();

_state = state;
SetState(state);
}
```

Expand Down Expand Up @@ -117,9 +117,9 @@ Inside of the **uap3:AppExtension** element, add a [uap3:Properties](/uwp/schema
<uap3:Properties>
<SingleTap>myapp-copilothotkey://?state=Tap</SingleTap>
<PressAndHoldStart>myapp-copilothotkey://?state=Down</PressAndHoldStart>
<PressAndHoldStop>myapp-copilothotkey:?//state=Up</PressAndHoldStop>
<PressAndHoldStop>myapp-copilothotkey://?state=Up</PressAndHoldStop>
</uap3:Properties>
</ uap3:AppExtension>
</uap3:AppExtension>
</uap3:Extension>
...
```
Expand Down Expand Up @@ -213,11 +213,9 @@ public MainWindow(string state)
this.InitializeComponent();

hWndMain = (HWND)WinRT.Interop.WindowNative.GetWindowHandle(this);
Microsoft.UI.Windowing.AppWindow appWindow = AppWindow;


var propertyStoreGUID = new Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99");
var hr = PInvoke.SHGetPropertyStoreForWindow((HWND)this.AppWindow.Id.Value, in propertyStoreGUID, out var propertyStore);
var hr = PInvoke.SHGetPropertyStoreForWindow(hWndMain, in propertyStoreGUID, out var propertyStore);
var key = new PROPERTYKEY();
var copilotFastpathGUID = new Guid("38652BCA-4329-4E74-86F9-39CF29345EEA");
key.fmtid = copilotFastpathGUID;
Expand All @@ -229,9 +227,9 @@ public MainWindow(string state)
((IPropertyStore)propertyStore).Commit();

SubClassDelegate = new Windows.Win32.UI.Shell.SUBCLASSPROC(WindowSubClass);
bool bRet = PInvoke.SetWindowSubclass((HWND)appWindow.Id.Value, SubClassDelegate, 0, 0);
bool bRet = PInvoke.SetWindowSubclass(hWndMain, SubClassDelegate, 0, 0);

_state = state;
SetState(state);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The `share_target` member must contain the necessary information for the system
},
```

When your app is selected by the user as the target for shared content, the PWA is launched. A `GET` HTTP request is made to the URL specified by the `action` property. The shared data is passed as the `title`, `text`, and `url` query parameters. The following request is made: `/handle-shared-content/?title=shared title&text=shared text&url=shared url`.
When your app is selected by the user as the target for shared content, the PWA is launched. A `POST` HTTP request is made to the URL specified by the `action` property. The shared data is posted to that URL when the share target is invoked.

The following example illustrates how to register the scoped service worker:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ no-loc: [Recall]

Many web browsers support a concept of "InPrivate" browsing, where the user's history does not get saved.

To make sure that Recall doesn't save your user's browsing history while in modes like this, your app can use the [`SetInputScope`](/windows/win32/api/inputscope/nf-inputscope-setinputscope) function, setting the input scope to `IS_PASSWORD`.
To make sure that Recall doesn't save your user's browsing history while in modes like this, your app can use the [`SetInputScope`](/windows/win32/api/inputscope/nf-inputscope-setinputscope) function, setting the input scope to `IS_PRIVATE`.

> [!IMPORTANT]
> Your app must also have a `http` or `https` protocol handler registered before `SetInputScope` will support the behavior described in this article.
Expand All @@ -24,7 +24,7 @@ private new enum InputScope : int
IS_DEFAULT = 0,
IS_URL = 1,
IS_FILE_FULLFILEPATH = 2,
IS_PRIVATE = 0x1f // Input is treated as private (e.g. passwords)
IS_PRIVATE = 61 // Input is treated as private data.
}

private void EnterInPrivateMode()
Expand Down