Jump to content

DspDefaultResolution: Difference between revisions

From EDM2
Created page with "This function is used to set or query information about the system's current default resolution. == Syntax == DspDefaultResolution(pScreenResolution, pcbScree..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function is used to set or query information about the system's current default resolution.  
This function is used to set or query information about the system's current default resolution.


== Syntax ==  
== Syntax ==  
  DspDefaultResolution(pScreenResolution,
  DspDefaultResolution(pScreenResolution, pcbScreenResolution, flOptions)
            pcbScreenResolution, flOptions);


== Parameters ==
== Parameters ==
; pScreenResolution (PSCREENRESOLUTION) - input  
;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.
: 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.
; pcbScreenResolution (PULONG) - input  
:DSP_RESOLUTION_OBTAINABLE Default resolution is obtained from the current hardware configuration.
: 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.  
:DSP_RESOLUTION_DEFAULT This is a default resolution.
 
:Example of structure pointed to by pScreenResolution:
; 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 {
     typedef struct _SCREENRESOLUTION {
         ULONG width;    /* width of the device in pels            */
         ULONG width;    /* width of the device in pels            */
Line 29: Line 19:
     } SCREENRESOLUTION;
     } SCREENRESOLUTION;
     typedef SCREENRESOLUTION *PSCREENRESOLUTION;
     typedef SCREENRESOLUTION *PSCREENRESOLUTION;


== Returns ==
== Returns ==
; fSuccess (ULONG) - returns : Return codes.  
;fSuccess (ULONG) - returns : Return codes.  
: On completion, this installation routine must return BOOLEAN (fSuccess).  
:On completion, this installation routine must return BOOLEAN (fSuccess).  
* TRUE Success  
*TRUE Success  
* FALSE Error  
*FALSE Error  


== Sample ==
<pre>
<pre>
#include <os2.h>
#include <os2.h>
Line 48: Line 36:
fSuccess = DspDefaultResolution(pScreenResolution,
fSuccess = DspDefaultResolution(pScreenResolution,
             pcbScreenResolution, flOptions);
             pcbScreenResolution, flOptions);
</pre>
</pre>


== Remarks ==
== 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.
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.


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 08:00, 22 February 2020

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
#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.