Jump to content

GreCloseScreenChangeArea: Difference between revisions

From EDM2
Created page with "GreCloseScreenChangeArea frees the data area internal to the display driver, identified by the SCA handle, that was accumulating screen changes. ;Simulation support: This fun..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreCloseScreenChangeArea frees the data area internal to the display driver, identified by the SCA handle, that was accumulating screen changes.
GreCloseScreenChangeArea frees the data area internal to the display driver, identified by the SCA handle, that was accumulating screen changes.


;Simulation support: This function is mandatory for display drivers that want to be DCAF-enabled.  
;Simulation support: This function is mandatory for display drivers that want to be DCAF-enabled.


== Syntax ==  
== Syntax ==  
  GreCloseScreenChangeArea(hdc, hsca, pdcArg, FunN);
  GreCloseScreenChangeArea(hdc, hsca, pdcArg, FunN)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Any valid device context.
:Any valid device context.  
;hsca (HSCA) - input:Handle of the SCA to be closed.
 
:To be valid, the handle must be obtained from a previous call to [[GreOpenScreenChangeArea]].
;hsca (HSCA) - input  
;pdcArg (PDC) - input:Pointer to instance data.
:Handle of the SCA to be closed.  
;FunN (ULONG) - input:High-order word=Flags; Low-order word=NGreCloseScreenChangeArea.
 
:To be valid, the handle must be obtained from a previous call to GreOpenScreenChangeArea.  
 
;pdcArg (PDC) - input  
:Pointer to instance data.  
 
;FunN (ULONG) - input  
:High-order word=Flags; Low-order word=NGreCloseScreenChangeArea.  


== Returns ==
== Returns ==
;rc (BOOL) - returns  
;rc (BOOL) - returns:This function returns one of the following:
:This function returns one of the following:  
:*TRUE If the handle passed is recognized and no errors occurred.
 
:*FALSE All other cases.
:*TRUE If the handle passed is recognized and no errors occurred.  
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
:*FALSE All other cases.  
:*PMERR_INV_HDC
 
:*PMERR_NO_HANDLE
:Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:  
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
 
:*PMERR_INV_HDC  
:*PMERR_NO_HANDLE  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
 


== Sample ==
== Sample ==
<pre>
<pre>
#define INCL_GRE_SCREEN
#define INCL_GRE_SCREEN
#include <os2.h>
#include <os2.h>
Line 49: Line 34:
BOOL    rc;
BOOL    rc;


rc = GreCloseScreenChangeArea(hdc, hsca, pdcArg,
rc = GreCloseScreenChangeArea(hdc, hsca, pdcArg, FunN);
      FunN);
 
</pre>
</pre>


== Remarks ==
== Remarks ==
It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.  
It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.


GreCloseScreenChangeArea calls EnterDriver and performs entry checks. The function checks that the hsca field matches one of the existing SCAs. If it does, the function removes the SCA from the linked list, frees the SCA memory via FreeMem and updates the linked list.  
GreCloseScreenChangeArea calls EnterDriver and performs entry checks. The function checks that the hsca field matches one of the existing SCAs. If it does, the function removes the SCA from the linked list, frees the SCA memory via FreeMem and updates the linked list.


If the SCA to be closed is the last created (that is, there are no more in the linked list), then GreSetProcessControl is called to turn off the COM_SCR_BOUND bit on subsequent calls to the display driver. Resetting this bit prevents any further screen bounds accumulation until another call is made to GreOpenScreenChangeArea.  
If the SCA to be closed is the last created (that is, there are no more in the linked list), then GreSetProcessControl is called to turn off the COM_SCR_BOUND bit on subsequent calls to the display driver. Resetting this bit prevents any further screen bounds accumulation until another call is made to GreOpenScreenChangeArea.


Before returning either TRUE or FALSE, GreCloseScreenChangeArea calls ExitDriver.  
Before returning either TRUE or FALSE, GreCloseScreenChangeArea calls ExitDriver.


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

Latest revision as of 02:26, 24 March 2020

GreCloseScreenChangeArea frees the data area internal to the display driver, identified by the SCA handle, that was accumulating screen changes.

Simulation support
This function is mandatory for display drivers that want to be DCAF-enabled.

Syntax

GreCloseScreenChangeArea(hdc, hsca, pdcArg, FunN)

Parameters

hdc (HDC) - input
Any valid device context.
hsca (HSCA) - input
Handle of the SCA to be closed.
To be valid, the handle must be obtained from a previous call to GreOpenScreenChangeArea.
pdcArg (PDC) - input
Pointer to instance data.
FunN (ULONG) - input
High-order word=Flags; Low-order word=NGreCloseScreenChangeArea.

Returns

rc (BOOL) - returns
This function returns one of the following:
  • TRUE If the handle passed is recognized and no errors occurred.
  • FALSE All other cases.
Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
  • PMERR_INV_HDC
  • PMERR_NO_HANDLE
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_SCREEN
#include <os2.h>
#include <pmddi.h>

HDC      hdc;     /*  Any valid device context. */
HSCA     hsca;    /*  Handle of the SCA to be closed. */
PDC      pdcArg;  /*  Pointer to instance data. */
ULONG    FunN;    /*  High-order word=Flags; Low-order word=NGreCloseScreenChangeArea. */
BOOL     rc;

rc = GreCloseScreenChangeArea(hdc, hsca, pdcArg, FunN);

Remarks

It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.

GreCloseScreenChangeArea calls EnterDriver and performs entry checks. The function checks that the hsca field matches one of the existing SCAs. If it does, the function removes the SCA from the linked list, frees the SCA memory via FreeMem and updates the linked list.

If the SCA to be closed is the last created (that is, there are no more in the linked list), then GreSetProcessControl is called to turn off the COM_SCR_BOUND bit on subsequent calls to the display driver. Resetting this bit prevents any further screen bounds accumulation until another call is made to GreOpenScreenChangeArea.

Before returning either TRUE or FALSE, GreCloseScreenChangeArea calls ExitDriver.