当前位置: 首页 > wzjs >正文

深圳o2o网站建设2023年最新新闻摘抄

深圳o2o网站建设,2023年最新新闻摘抄,互联网公司排名2023,wordpress文章中带轮播图API 更改 ADS 功能增加了以下公共 API 功能: 枚举系统中的多路复用器设备。查询有关多路复用器的信息,例如,它连接了哪些目标,以及当前切换到哪个目标。触发多路复用器切换。如何检测多路复用器是否已切换。 枚举系统中的多路复…
API 更改

ADS 功能增加了以下公共 API 功能:

  1. 枚举系统中的多路复用器设备。
  2. 查询有关多路复用器的信息,例如,它连接了哪些目标,以及当前切换到哪个目标。
  3. 触发多路复用器切换。
  4. 如何检测多路复用器是否已切换。
枚举系统中的多路复用器设备

应用程序可以使用通用的即插即用 API 来查找代表正常显示多路复用器的设备接口。 用户模式组件可使用Windows.Devices.Enumeration.DeviceInformation。 无论是 C# 还是 C++,都可以使用这些 API 来枚举多路复用器设备。

// Display Mux device interface
// {93c33929-3180-46d3-8aab-008c84ad1e6e}
DEFINE_GUID(GUID_DEVINTERFACE_DISPLAYMUX, 0x93c33929, 0x3180, 0x46d3, 0x8a, 0xab, 0x00, 0x8c, 0x84, 0xad, 0x1e, 0x6e);
IDisplayMuxDevice 接口

添加 IDisplayMuxDevice 接口来表示多路复用器设备。

以下代码演示了如何使用 Windows Runtime API 枚举显示多路复用器设备、查询其状态、切换活动显示目标以及对状态变化做出反应。

#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Devices.Enumeration.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Devices.Display.Core.h>#include <string>
#include <sstream>
#include <iomanip>
#include <windows.h>namespace winrt
{
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Windows::Devices::Enumeration;
using namespace winrt::Windows::Devices::Display;
using namespace winrt::Windows::Devices::Display::Core;
} // namespace winrtvoid SwitchDisplayMuxTarget()
{// PnP device interface search string for Mux device interfacestd::wstring muxDeviceSelector = L"System.Devices.InterfaceClassGuid:=\"{93c33929-3180-46d3-8aab-008c84ad1e6e}\" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True";// Execute the device interface querywinrt::DeviceInformationCollection deviceInformations = winrt::DeviceInformation::FindAllAsync(muxDeviceSelector, nullptr).get();if (deviceInformations.Size() == 0){printf("No DisplayMux devices\n");return;}printf("%ld display mux devices found\n\n", deviceInformations.Size());// Only one mux in first release but here is generic code for multiplefor (unsigned int i = 0; i < deviceInformations.Size(); i++){printf("Display Mux device %ld :\n", i);// Get the device interface so we can query the infowinrt::DeviceInformation deviceInfo = deviceInformations.GetAt(i);// Get the device idstd::wstring deviceId = deviceInfo.Id().c_str();printf("    Device ID string : %S \n", deviceId.c_str());// Create the DisplayMuxDevice objectauto displayMuxDevice = winrt::DisplayMuxDevice::FromIdAsync(deviceId).get();if (!displayMuxDevice){printf("Failed to create DisplayMuxDevice object");continue;}// Check if DisplayMux is activeauto displayMuxActive = displayMuxDevice.IsActive();printf("    DisplayMux state : %s \n", displayMuxActive ? "Active" : "Inactive");if (!displayMuxActive){continue;}// Register for call back when the state of the DisplayMux changesUINT changeCount = 0;auto token = displayMuxDevice.Changed([&changeCount](auto, auto Args) -> HRESULT {changeCount++;return S_OK;});// Find targets connected to the DisplayMux and the current targetauto targetsList = displayMuxDevice.GetAvailableMuxTargets();winrt::DisplayTarget currentTarget = displayMuxDevice.CurrentTarget();// Switch the display mux to the other target// NOTE SetPreferredTarget() is a sync method so use .get() to wait for the operation to completeprintf("\n");if (currentTarget == targetsList.GetAt(0)){printf("DisplayMux currently connected to first target\n");displayMuxDevice.SetPreferredTarget(targetsList.GetAt(1)).get();printf("Calling SetPreferredTarget to switch DisplayMux to second target\n");}else if (currentTarget == targetsList.GetAt(1)){printf("DisplayMux currently connected to second target\n");displayMuxDevice.SetPreferredTarget(targetsList.GetAt(0)).get();printf("Calling SetPreferredTarget to switch DisplayMux to first target\n");}else{printf("Could not find current target in target list\n");}// Now read the current positioncurrentTarget = displayMuxDevice.CurrentTarget();targetsList = displayMuxDevice.GetAvailableMuxTargets();if (currentTarget == targetsList.GetAt(0)){printf("DisplayMux is now currently connected to first target\n");}else if (currentTarget == targetsList.GetAt(1)){printf("DisplayMux is now currently connected to second target\n");}else{printf("Could not find current target in target list\n");}// Now unregister for change callback and display thedisplayMuxDevice.Changed(token);printf("DisplayMux state change callback was called %ld times\n\n", changeCount);}
}
http://www.dtcms.com/wzjs/143329.html

相关文章:

  • 网站模板怎么使用深圳网络推广平台
  • 网站推广策划报告航空航天邵阳seo排名
  • 南山区公司网站制作肇庆seo外包公司
  • 51aspx源码seo如何优化网站步骤
  • 备案里的网站名称百度电话怎么转人工
  • 帝国生成网站地图东莞seo网络推广专
  • 如何做购物网站小程序开发公司前十名
  • 网站建设与管理的未来规划方案个人模板建站
  • 私服广告网站谁做的网站展示型推广
  • 甘洛网站建设湖南seo网站多少钱
  • 一家公司做两个网站吗企业网站seo服务
  • 用手机制作app用哪个软件关键词优化公司推荐
  • 网站建设功能报价表网站测速
  • 网站建设设计开发公司软件推广是什么工作
  • 长城集团建设有限公司网站网站怎么优化关键词
  • 高端网站建设高端网站建设专家市场推广专员
  • 做彩票网站需要什么收钱的郑州做网站推广哪家好
  • 响应式网站建设济南口碑营销是什么意思
  • 专业的上海网站建设公司排名2024小学生时事新闻十条
  • 手机网站 cms舆情视频
  • 网站建设费用评估重庆seo培训
  • 建网站域名后怎样做百度正版下载恢复百度
  • 二手交易网站建设内容策划seo快速优化方法
  • 苏州市智信建设职业培训学校网站2022年7到8月份的十大新闻
  • 商城网站建设付款怎么实现关键词指数
  • 如何用阿里云做私服网站网站案例
  • 一键建设网站自助建站网站哪个好
  • 网站管理平台扩展插件爱站网综合查询
  • 网站可以做无形资产怎样做推广营销
  • 美团网站开发合作商关键词推广哪家好