iDisplayModes question

delphi package - easy access to shell apis

iDisplayModes question

Postby swamped » Tue Jul 20, 2004 12:00 pm

I've just started checking out madCollection, working thru some of the examples, and am pretty impressed. :)

A question on iDisplayModes: the example works fine on the primary "monitor", but the interface doesn't seem to permit enumeration of other "monitors" (in a multimonitor array) - did I miss something?

And this may be a stupid question, so apologies in advance. :)
Is it possible to "inject" a resolution into the list that Windows returns with EnumDisplaySettings() - one that isn't normally returned by the display driver?

I realize that that might seem like a pointless thing to do, but I have my reasons... I'm just wondering if its possible?

Thanks in advance...
swamped
 
Posts: 14
Joined: Tue Jul 20, 2004 11:49 am

Re: iDisplayModes question

Postby madshi » Tue Jul 20, 2004 1:25 pm

swamped wrote:A question on iDisplayModes: the example works fine on the primary "monitor", but the interface doesn't seem to permit enumeration of other "monitors" (in a multimonitor array) - did I miss something?

I've not yet done anything for multi monitor support. Probably I should, but then I need 2 monitors first...

swamped wrote:Is it possible to "inject" a resolution into the list that Windows returns with EnumDisplaySettings() - one that isn't normally returned by the display driver?

Well, you can not really inject a new display mode into the list of display modes, but you can nevertheless work with a new display mode by using the function "DisplayMode". Does that help?

Code: Select all
function DisplayMode (width        : integer;
                      height       : integer;
                      bitsPerPixel : integer;
                      refreshRate  : integer = 0) : IDisplayMode;
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm

Postby swamped » Tue Jul 20, 2004 1:55 pm

Thanks for the quick reply. That doesn't help, but I'm not surprised. I'm programming the graphics card to a "non-standard" resolution, and I was looking for a way to get Windows to use the resolution. Right now, e.g., if I program the hardware to 1032x776, I just end up with 1024x768 and 8 lines and rows of pixel garbage on screen.
swamped
 
Posts: 14
Joined: Tue Jul 20, 2004 11:49 am

Postby madshi » Tue Jul 20, 2004 2:11 pm

I've just checked. With the NVidia driver you can add custom resolutions. I've tried 1032x768 and it works just fine. I've no idea how to do this programatically, though. I think the NVidia control panel directly talks to the NVidia driver. I'm not aware of any API which would offer this kind of functionality.
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm

Postby swamped » Tue Jul 20, 2004 3:20 pm

Thanks - I wanted to add this to drivers that do not support custom resolutions. Perhaps a filter driver...
swamped
 
Posts: 14
Joined: Tue Jul 20, 2004 11:49 am

Postby madshi » Wed Jul 21, 2004 6:17 am

I'm sorry to say but I've no idea how that would work.

Well, maybe adding the resolutions to the registry is already good enough? You know there are some registry keys where all the resolution information is listed. If you add a custom resolution there, the driver might accept that. I'm not sure, though.
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm

Postby swamped » Wed Jul 21, 2004 9:54 am

Thanks for the idea, but I've been down that road already. So I wonder if it is would be possible and suffice to hook the EnumDisplaySettings() API call and modify the result, adding more devmodes?

Probably this is already too late. EnumDisplayModes() is how applications get a list of display modes from Windows. How does Windows get its list? Just musing... :)
swamped
 
Posts: 14
Joined: Tue Jul 20, 2004 11:49 am

Postby madshi » Wed Jul 21, 2004 10:18 am

Well, it's no problem to hook EnumDisplayModes and to simulate a new mode there. The real problem is to make the driver display that new mode.

I'd suggest using RegMon and FileMon to see what NVidia's control panel does when you add a custom resolution. If it's only adding some registry keys/values (what I suspect) you should be able to see whether those are NVidia specific or whether they might work with other IHVs, too.
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm


Return to madShell

Who is online

Users browsing this forum: No registered users and 2 guests