You will need to use a private CoreGraphics routine to get the list of all displays including inactive ones, and then request a rescan of the bus. Try it like this:
#include <IOKit/IOKitLib.h>
#include <IOKit/IOTypes.h>
CGDisplayErr CGSGetDisplayList(CGDisplayCount maxDisplays,
CGDirectDisplayID * onlineDspys,
CGDisplayCount * dspyCnt);
static void DetectDisplays()
{
CGDirectDisplayID displays[8];
CGDisplayCount dspCount = 0;
if (CGSGetDisplayList(8, displays, &dspCount) == noErr)
{
for(int i = 0; i < dspCount; i++)
{
io_service_t service = CGDisplayIOServicePort(displays[i]);
if (service)
IOServiceRequestProbe(service, kIOFBUserRequestProbe);
}
}
}
And link to ApplicationServices and IOKit.
Ken Aspeslagh
2010-01-18 23:11:53