// test.cpp : 定义应用程序的入口点。 // #include "stdafx.h" #include "test.h" #include <PhysicalMonitorEnumerationAPI.h> #include <HighLevelMonitorConfigurationAPI.h> #pragma comment(lib, "dxva2.lib") int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { HMONITOR hMonitor = NULL; DWORD cPhysicalMonitors; LPPHYSICAL_MONITOR pPhysicalMonitors = NULL; // Get the monitor handle. hMonitor = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTOPRIMARY); // Get the number of physical monitors. BOOL bSuccess = GetNumberOfPhysicalMonitorsFromHMONITOR( hMonitor, &cPhysicalMonitors ); if (bSuccess) { // Allocate the array of PHYSICAL_MONITOR structures. pPhysicalMonitors = (LPPHYSICAL_MONITOR)malloc( cPhysicalMonitors* sizeof(PHYSICAL_MONITOR)); if (pPhysicalMonitors != NULL) { // Get the array. bSuccess = GetPhysicalMonitorsFromHMONITOR( hMonitor, cPhysicalMonitors, pPhysicalMonitors); // Use the monitor handles (not shown). RestoreMonitorFactoryDefaults(pPhysicalMonitors->hPhysicalMonitor); // Close the monitor handles. bSuccess = DestroyPhysicalMonitors( cPhysicalMonitors, pPhysicalMonitors); // Free the array. free(pPhysicalMonitors); } } return 0; }
分类:
显示器恢复出厂工具(成品 源码)
文章作者:admin
办站宗旨:收集和分享一些实用的工具,好用的网吧系统,解决问题经验等,保证都是非常实用的工具。做这个博客,我一直把用户体验放在第一位。