-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows 11 Version 22H2 - October 2023 Samples Update
* WebAuthenticationBroker: Remove Google support (issue #1376) * New: MobileHotspot, LampArray
- Loading branch information
Raymond Chen
authored and
Raymond Chen
committed
Oct 5, 2023
1 parent
7d37b03
commit bd31b44
Showing
58 changed files
with
4,578 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
page_type: sample | ||
languages: | ||
- csharp | ||
- cppwinrt | ||
- cpp | ||
products: | ||
- windows | ||
- windows-uwp | ||
urlFragment: LampArray | ||
extendedZipContent: | ||
- path: SharedContent | ||
target: SharedContent | ||
- path: LICENSE | ||
target: LICENSE | ||
description: "Shows how to control RGB lighting of compatible peripheral devices." | ||
--- | ||
|
||
<!--- | ||
category: DevicesSensorsAndPower | ||
--> | ||
|
||
# LampArray sample | ||
|
||
This sample shows how to control RGB lighting of peripheral devices using the [Windows.Devices.Lights](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights) and [Windows.Devices.Lights.Effects](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.effects) APIs. | ||
|
||
Supported devices conform to the [HID Lighting and Illumination Standard](https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf). | ||
|
||
Specifically, this sample shows how to: | ||
|
||
- Use [Windows.Devices.Enumeration.DeviceWatcher](https://learn.microsoft.com/en-us/uwp/api/windows.devices.enumeration.devicewatcher) with an AQS filter to register for LampArray attach and removal events. | ||
|
||
- Obtain instances of [Windows.Devices.Lights.LampArray](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.lamparray) and use them to query device properties and change RGB lighting colors and brightness. | ||
|
||
- Create compelling RGB lighting effects using the [Windows.Devices.Lights.Effects](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.effects) APIs. | ||
|
||
- Create an app package with the "com.microsoft.windows.lighting" AppExtension. The sample will assume control of lighting when in the foreground. Declaring the "com.microsoft.windows.lighting" AppExtension will allow the sample to appear in the Dynamic Lighting page of Windows Settings, where it can be prioritized for lighting control when not in the foreground (supported on Windows build 23466 and above). | ||
|
||
**Note** The Windows universal samples require Visual Studio to build and Windows 10 to execute. | ||
|
||
To obtain information about Windows 10 development, go to the [Windows Dev Center](http://go.microsoft.com/fwlink/?LinkID=532421). | ||
|
||
To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422). | ||
|
||
### Reference | ||
|
||
[Windows.Devices.Lights](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights) | ||
|
||
[Windows.Devices.Lights.Effects](https://learn.microsoft.com/en-us/uwp/api/windows.devices.lights.effects) | ||
|
||
[Windows.Devices.Enumeration.DeviceWatcher](https://learn.microsoft.com/en-us/uwp/api/windows.devices.enumeration.devicewatcher) | ||
|
||
### Conceptual | ||
|
||
[HID Lighting and Illumination Standard](https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf) | ||
|
||
[Dynamic Lighting](https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/lighting-dynamic-lamparray) - This page also describes how to declare the "com.microsoft.windows.lighting" AppExtension for background (ambient) lighting control. | ||
|
||
[Dynamic lighting devices](https://learn.microsoft.com/en-us/windows-hardware/design/component-guidelines/dynamic-lighting-devices) - This page contains a list of devices known to be compatible with the above HID Lighting standard. | ||
|
||
## System requirements | ||
|
||
**Client:** Windows 10, version 17763 or above. | ||
|
||
**Server:** Not supported. | ||
|
||
## Build the sample | ||
|
||
1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build. | ||
2. Start Microsoft Visual Studio and select **File** \> **Open** \> **Project/Solution**. | ||
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++ or C#). Double-click the Visual Studio Solution (.sln) file. | ||
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**. | ||
|
||
## Run the sample | ||
|
||
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it. | ||
|
||
### Deploying the sample | ||
|
||
- Select Build > Deploy Solution. | ||
|
||
### Deploying and running the sample | ||
|
||
- To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.6.33723.286 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LampArray", "LampArray.vcxproj", "{6619AD8E-72C9-492A-BC8A-2AF1995E226E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|ARM = Debug|ARM | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|ARM = Release|ARM | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|ARM.ActiveCfg = Debug|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|ARM.Build.0 = Debug|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|ARM.Deploy.0 = Debug|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x64.ActiveCfg = Debug|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x64.Build.0 = Debug|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x64.Deploy.0 = Debug|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x86.ActiveCfg = Debug|Win32 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x86.Build.0 = Debug|Win32 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Debug|x86.Deploy.0 = Debug|Win32 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|ARM.ActiveCfg = Release|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|ARM.Build.0 = Release|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|ARM.Deploy.0 = Release|ARM | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x64.ActiveCfg = Release|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x64.Build.0 = Release|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x64.Deploy.0 = Release|x64 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x86.ActiveCfg = Release|Win32 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x86.Build.0 = Release|Win32 | ||
{6619AD8E-72C9-492A-BC8A-2AF1995E226E}.Release|x86.Deploy.0 = Release|Win32 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {9FD4241E-48DF-497E-B1AD-92AA02ED08AD} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props')" /> | ||
<PropertyGroup> | ||
<SharedContentDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), LICENSE))\SharedContent</SharedContentDir> | ||
</PropertyGroup> | ||
<PropertyGroup Label="Globals"> | ||
<MinimalCoreWin>true</MinimalCoreWin> | ||
<ProjectGuid>{6619AD8E-72C9-492A-BC8A-2AF1995E226E}</ProjectGuid> | ||
<ProjectName>LampArray</ProjectName> | ||
<RootNamespace>SDKTemplate</RootNamespace> | ||
<DefaultLanguage>en-US</DefaultLanguage> | ||
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion> | ||
<AppContainerApplication>true</AppContainerApplication> | ||
<ApplicationType>Windows Store</ApplicationType> | ||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision> | ||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion> | ||
<WindowsTargetPlatformMinVersion>$(WindowsTargetPlatformVersion)</WindowsTargetPlatformMinVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|ARM"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|ARM"> | ||
<Configuration>Release</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<LinkIncremental>true</LinkIncremental> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<LinkIncremental>false</LinkIncremental> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup> | ||
<IncludePath>$(VC_IncludePath);$(UniversalCRT_IncludePath);$(WindowsSDK_IncludePath);$(SharedContentDir)\cppwinrt</IncludePath> | ||
<CppWinRTOptimized>true</CppWinRTOptimized> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> | ||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile> | ||
<WarningLevel>Level4</WarningLevel> | ||
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions> | ||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> | ||
<ClCompile> | ||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClInclude Include="$(SharedContentDir)\cppwinrt\App.h"> | ||
<DependentUpon>$(SharedContentDir)\xaml\App.xaml</DependentUpon> | ||
</ClInclude> | ||
<ClInclude Include="$(SharedContentDir)\cppwinrt\MainPage.h"> | ||
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon> | ||
</ClInclude> | ||
<ClInclude Include="SampleConfiguration.h" /> | ||
<ClInclude Include="Scenario1_Basics.h"> | ||
<DependentUpon>..\shared\Scenario1_Basics.xaml</DependentUpon> | ||
</ClInclude> | ||
<ClInclude Include="Scenario2_Effects.h"> | ||
<DependentUpon>..\shared\Scenario2_Effects.xaml</DependentUpon> | ||
</ClInclude> | ||
<ClInclude Include="pch.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ApplicationDefinition Include="$(SharedContentDir)\xaml\App.xaml"> | ||
<SubType>Designer</SubType> | ||
</ApplicationDefinition> | ||
<Page Include="$(SharedContentDir)\xaml\MainPage.xaml"> | ||
<SubType>Designer</SubType> | ||
</Page> | ||
<Page Include="..\shared\Scenario1_Basics.xaml" /> | ||
<Page Include="..\shared\Scenario2_Effects.xaml" /> | ||
<Page Include="$(SharedContentDir)\xaml\Styles.xaml"> | ||
<Link>Styles\Styles.xaml</Link> | ||
</Page> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="$(SharedContentDir)\cppwinrt\App.cpp"> | ||
<DependentUpon>$(SharedContentDir)\xaml\App.xaml</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="$(SharedContentDir)\cppwinrt\MainPage.cpp"> | ||
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="SampleConfiguration.cpp"> | ||
<DependentUpon>SampleConfiguration.h</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="Scenario1_Basics.cpp"> | ||
<DependentUpon>..\shared\Scenario1_Basics.xaml</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="Scenario2_Effects.cpp"> | ||
<DependentUpon>..\shared\Scenario2_Effects.xaml</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="pch.cpp"> | ||
<PrecompiledHeader>Create</PrecompiledHeader> | ||
<DependentUpon>pch.h</DependentUpon> | ||
</ClCompile> | ||
<ClCompile Include="$(GeneratedFilesDir)module.g.cpp"> | ||
<DependentUpon>Project.idl</DependentUpon> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Midl Include="$(SharedContentDir)\cppwinrt\MainPage.idl"> | ||
<DependentUpon>$(SharedContentDir)\xaml\MainPage.xaml</DependentUpon> | ||
</Midl> | ||
<Midl Include="Project.idl" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<AppxManifest Include="Package.appxmanifest"> | ||
<SubType>Designer</SubType> | ||
</AppxManifest> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Image Include="$(SharedContentDir)\media\microsoft-sdk.png"> | ||
<Link>Assets\microsoft-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\smalltile-sdk.png"> | ||
<Link>Assets\smallTile-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\splash-sdk.png"> | ||
<Link>Assets\splash-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\squaretile-sdk.png"> | ||
<Link>Assets\squareTile-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\storelogo-sdk.png"> | ||
<Link>Assets\storeLogo-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\tile-sdk.png"> | ||
<Link>Assets\tile-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\windows-sdk.png"> | ||
<Link>Assets\windows-sdk.png</Link> | ||
</Image> | ||
<Image Include="$(SharedContentDir)\media\Samples\grapes.jpg"> | ||
<Link>Assets\grapes.jpg</Link> | ||
</Image> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
<Import Project="packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets')" /> | ||
<Import Project="packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets" Condition="Exists('packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" /> | ||
</ImportGroup> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.props'))" /> | ||
<Error Condition="!Exists('packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Windows.CppWinRT.2.0.210922.5\build\native\Microsoft.Windows.CppWinRT.targets'))" /> | ||
<Error Condition="!Exists('packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Win2D.uwp.1.26.0\build\native\Win2D.uwp.targets'))" /> | ||
</Target> | ||
</Project> |
Oops, something went wrong.