Jump to content

DspDefaultResolution

From EDM2
Revision as of 03:23, 12 December 2019 by Martini (talk | contribs) (Created page with "This function is used to set or query information about the system's current default resolution. == Syntax == DspDefaultResolution(pScreenResolution, pcbScree...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function is used to set or query information about the system's current default resolution.

Syntax

DspDefaultResolution(pScreenResolution,
            pcbScreenResolution, flOptions);

Parameters

pScreenResolution (PSCREENRESOLUTION) - input
If flOptions==DSP_SET_DEFAULT_RESOLUTIONS, this parameter points to ScreenResolution structure to be saved to the INI file. If not, this parameter points to the buffer that receives the default values currently saved in the INI file.
pcbScreenResolution (PULONG) - input
Points to the count of bytes in the pScreenResolution buffer. If pScreenResolution is NULL on input, the function will store the count of bytes needed to store all of the resolution data in pcbScreenResolution. If not ZERO, upon return, that field contains the number of bytes actually returned.
flOptions (ULONG) - input
Used to specify whether to SET or QUERY the default resolution. If flOptions==DSP_SET_DEFAULT_RESOLUTIONS, the values are SET (written) in the INI file. Otherwise, the INI file is QUERYED.
DSP_RESOLUTION_OBTAINABLE Default resolution is obtained from the current hardware configuration.
DSP_RESOLUTION_DEFAULT This is a default resolution.
Example of structure pointed to by pScreenResolution:
    typedef struct _SCREENRESOLUTION {
       ULONG width;    /* width of the device in pels             */
       ULONG height;   /* height of the device in pels            */
       ULONG colors;   /* number of colors supported in this mode */
       ULONG planes;   /* number of display planes in this mode   */
       ULONG flOptions /* identifies optional information for each resolution*/
    } SCREENRESOLUTION;
    typedef SCREENRESOLUTION *PSCREENRESOLUTION;


Returns

fSuccess (ULONG) - returns
Return codes.
On completion, this installation routine must return BOOLEAN (fSuccess).
  • TRUE Success
  • FALSE Error

Sample

#include <os2.h>

PSCREENRESOLUTION    pScreenResolution;
PULONG               pcbScreenResolution;
ULONG                flOptions;
ULONG                fSuccess;             /*  Return codes. */

fSuccess = DspDefaultResolution(pScreenResolution,
             pcbScreenResolution, flOptions);

Remarks

It can be used to change the system's display resolution. Such a change takes effect the next time the system is restarted. PM display drivers that can support multiple resolutions use the function during their initialization to discover the current display resolution that has been selected by the user.