# SaveScreen

The SaveScreen function saves a screen area. To restore it use the RestoreScreen function.

    HANDLE WINAPI SaveScreen(
      int X1,
      int Y1,
      int X2,
      int Y2
    );

### Parameters

X1,Y1,X2,Y2
Screen area coordinates. If X2 or Y2 is equal to `-1`, they are replaced with screen right or screen bottom coordinate correspondingly. So `SaveScreen(0,0,-1,-1)` will save the entire screen.

### Return value

The return value is a handle that can be passed to RestoreScreen. All handles allocated by SaveScreen must be passed to RestoreScreen to avoid memory leaks.

See also:
RestoreScreen