terminal video resolution APIs

Is there an win32 API to find out the monitor resolution ? To set the monitor resoultion.

Comments

  • [b][red]This message was edited by pingpong at 2002-10-9 12:37:38[/red][/b][hr]
    You can do:
    [code]
    HDC hDC = GetDC(NULL); // screen DC.
    int width = GetDeviceCaps(hDC, HORZRES);
    int height = GetDeviceCaps(hDC, VERTRES);
    int bitsPerPixel = GetDeviceCaps(hDC, BITSPIXEL);

    /////////////////
    // if you really want to be accurate.. Windows could work on 16-colors VGA,
    // this uses planes and not bits/pixel
    int planes = GetDeviceCaps(hDC, PLANES);
    if(planes > 1)
    bitsPerPixel = planes;
    /////////////////

    ReleaseDC(hDC);
    [/code]

    As for changing the current settings, look up ChangeDisplaySettings and EnumDisplaySettings. I have some code that works with those here:
    http://www.geocities.com/al_ani/resolutioner.zip

    : Is there an win32 API to find out the monitor resolution ? To set the monitor resoultion.
    :
    :



  • Thanks much.
    : [b][red]This message was edited by pingpong at 2002-10-9 12:37:38[/red][/b][hr]
    : You can do:
    : [code]
    : HDC hDC = GetDC(NULL); // screen DC.
    : int width = GetDeviceCaps(hDC, HORZRES);
    : int height = GetDeviceCaps(hDC, VERTRES);
    : int bitsPerPixel = GetDeviceCaps(hDC, BITSPIXEL);
    :
    : /////////////////
    : // if you really want to be accurate.. Windows could work on 16-colors VGA,
    : // this uses planes and not bits/pixel
    : int planes = GetDeviceCaps(hDC, PLANES);
    : if(planes > 1)
    : bitsPerPixel = planes;
    : /////////////////
    :
    : ReleaseDC(hDC);
    : [/code]
    :
    : As for changing the current settings, look up ChangeDisplaySettings and EnumDisplaySettings. I have some code that works with those here:
    : http://www.geocities.com/al_ani/resolutioner.zip
    :
    : : Is there an win32 API to find out the monitor resolution ? To set the monitor resoultion.
    : :
    : :
    :
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories