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

网站改版的宣传词网站推广代理

网站改版的宣传词,网站推广代理,买空间哪个网站好,公司做网站的费用属什么用途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.yidumall.com/news/102717.html

相关文章:

  • 网站优化北京哪家强?视频推广方案模板
  • 萌宝宝投票网站怎么做百度搜索引擎营销如何实现
  • 集团公司网站建设策划方案如何交换友情链接
  • 外贸出口网站建设app推广渠道商
  • 北京朝阳社会建设工作办公室网站seo咨询推广找推推蛙
  • 小红书网站开发费用苏州百度快照优化排名
  • 广东网站制作哪家强做网站用哪个软件
  • 手机微网站二级菜单怎么做百度seo工作室
  • 门户网站怎么做seo百度精准引流推广
  • 柳州 网站开发seo网站推广企业
  • 网站建设分金手指专业友情手机站
  • 中国建设管理信息网站网文网站排名
  • 数据库php网站开发论文网站优化设计公司
  • 华为怎么设置安全网站如何申请百度竞价排名
  • 学校网站建设毕业论文百度seo公司哪家好一点
  • 网站上全景云台怎么做的百度游戏官网
  • 杭州网站建设公司服务四川二级站seo整站优化排名
  • 产品线上营销有哪些方式百度seo效果
  • 网站被禁止访问怎么打开推广app下载
  • jsp做网站视频教程如何免费建立一个网站
  • 建设一个电子文学网站资金多少百度账号查询
  • 无锡网站制作公司报价市场调研表模板
  • 廊坊做网站哪家好石家庄seo外包的公司
  • 东莞做网站优化做网络推广怎么找客户
  • 衡水企业网站设计百度指数专业版价格
  • 做多级分销的网站海南百度竞价推广
  • 可以做专利聚类分析的免费网站全球外贸采购网
  • 批量网站访问检测seo网络优化师招聘
  • 网页打不开pdf文件怎么办慈溪seo
  • 企业形象设计vi模板seo 优化