我相信有人需要这个。
- HDEVINFO hDevInfo = NULL;
- DWORD dwIndex = 1;
- SP_DEVINFO_DATA DevInfo_data;
- ZeroMemory(&DevInfo_data, sizeof(SP_DEVINFO_DATA));
- DevInfo_data.cbSize = sizeof(SP_DEVINFO_DATA);
- hDevInfo = SetupDiGetClassDevs(
- (LPGUID) &GUID_DEVCLASS_DISPLAY,
- 0, // Enumerator
- 0,
- DIGCF_PRESENT
- );
- if (hDevInfo == INVALID_HANDLE_VALUE)
- {
- return;
- }