Detaching the monitor work with this but im facing a problem after the monitor is detached. I don't see it anymore in the windows screen resolution dialog , everytime the monitor detached is hidden from the list.
DEVMODE DevMode; ZeroMemory(&DevMode, sizeof(DevMode)); DevMode.dmSize = sizeof(DevMode); DevMode.dmFields = DM_POSITION | DM_PELSWIDTH | DM_PELSHEIGHT; Result = ChangeDisplaySettingsEx((LPSTR)DisplayDevice.DeviceName, &DevMode, NULL, CDS_UPDATEREGISTRY | CDS_RESET, NULL);