[英]How can I get a list of all APIs used by particular process (Windows 7)
[英]How can you get the display adapter used for a particular monitor in Windows?
在Mac上,我可以使用以下命令打印出用於特定顯示器的適配器:
io_registry_entry_t dspPort = CGDisplayIOServicePort(displays[i]);
CFDataRef model_;
model_ = (CFDataRef)IORegistryEntrySearchCFProperty(dspPort,kIOServicePlane,CFSTR("model"),
kCFAllocatorDefault,
kIORegistryIterateRecursively | kIORegistryIterateParents);
if (model_) {
newLine();
String model((const char*)CFDataGetBytePtr(model_), CFDataGetLength(model_));
log.printf("Adapter: %s", model.buf);
CFRelease(model_);
}
示例輸出 - 適配器:AMD Radeon HD 6750M
其中CGGetActiveDisplayList(nDisplays, displays, &nDisplays);
displays[i]
使用CGGetActiveDisplayList(nDisplays, displays, &nDisplays);
填充CGGetActiveDisplayList(nDisplays, displays, &nDisplays);
有什么辦法可以在Windows上執行等效操作嗎? 我正在使用EnumDisplayMonitors
遍歷所有顯示器。
我可以使用EnumDisplayDevices
獲取適配器列表,但是如何查看哪個適配器連接到哪個適配器?
編輯
使用:
for (int i=0; EnumDisplayDevicesA(monitorInfo.szDevice, i, &dev, 0); i++) {
newLine();
log.printf("Display Device: %s",(char*)dev.DeviceString);
}
我可以獲取顯示器本身的設備名稱,但不能獲取它們所連接的適配器!
我可以想到三種方法:
EnumDisplayDevices
文檔提到dwFlags
參數可用於獲取可與SetupAPI函數一起使用的設備ID。 該API提供了一系列功能來獲取設備信息 。 因此,您可以從EnumDisplayDevices
獲取設備ID,將其粘貼到某些SetupAPI函數中以獲取監視器設備結構,並從那里獲取顯示適配器設備ID。
您可能可以通過WMI使用Win32_VideoController
類來獲取顯示適配器信息。
我可以想象一些DirectX API可用於獲取有關已安裝圖形硬件的信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.