Following Visual c++ 2008 Express' help on multiple monitors, I've managed to get a list of monitor devices via EnumDisplayDevices(..) [first enumerating adapters, then monitors in an inner loop]. Now I want to paint to one of the monitors; the help says I should just use
"hdc = CreateDC(lpszDisplayName, NULL, NULL, lpDevMode);
In this call, the lpszDisplayName parameter is one of the device names returned by EnumDisplayDevices and lpDevMode is a description of the graphics mode for this device. "
When I try this (with DISPLAY_DEVICE.DeviceName from EnumDisplayDevices, e.g. "\\.\DISPLAY1\Monitor0", as lpszDisplayName, and NULL as lpDevMode), I get the error code ERROR_INVALID_PRINTER_NAME (1801).
How can I fix this?
And could anyone help me towards preparing a minimalistic DevMode for just any graphics mode (ok, maybe of a given resolution)?