Get copy of a screen data structure.
Source position: intuition.pas line 3258
function GetScreenData( |
Buffer: Pointer; |
Size: LongWord; |
Type_: LongWord; |
Screen: PScreen |
):LongInt; |
Buffer |
|
A pointer to a buffer into which data can be copied |
Size |
|
The size of the buffer provided, in bytes |
Type_ |
|
The screen type, as specified in OpenWindow() (WBENCHSCREEN_f, CUSTOMSCREEN_f, ...) |
Screen |
|
Ignored, unless type is CUSTOMSCREEN_f, which results only in copying 'size' bytes from 'screen' to 'buffer' |
True if successful. False if standard screen of Type 'type' could not be opened.
This function copies into the caller's buffer data from a Screen structure. Typically, this call will be used to find the size, title bar height, and other values for a standard screen, such as the Workbench screen.
To get the data for the Workbench screen, one would call:
GetScreenData(buff, SizeOf(TScreen), WBENCHSCREEN_f, nil);
Note: If the requested standard screen is not open, this function will have the effect of opening it.
This function has been useful for two basic types of things:
The function LockPubScreen() is an improvement over this function, in that it doesn't copy the screen data but returns a pointer and a guarantee that the screen will not be closed.
If the global public screen SHANGHAI mode is in effect (see SetPubScreenModes()), this function will actually report on the default public screen, where "Workbench" windows will actually open.
This function does some "compatibility tricks" when you inquire about the WBENCHSCREEN_f. To keep programs from "stumbling" into modes they don't understand, and because an NTSC machine may be running a PAL Workbench or PRODUCTIVITY, for example, the following "false" information is returned.
The Screen.ViewPort.Modes field will either be HIRES or HIRES+LACE (with the SPRITES flag also set, as usual). HIRES+LACE is used if the display mode selected for the Workbench screen is an interlaced screen of any type.
The dimensions returned will be the smaller of the OSCAN_TEXT dimensions for the returned mode, and the actual dimensions of the Workbench screen.
Exception: For specific compatibility considerations, if the Workbench is in one of the A2024 modes, the mode returned in Screen.ViewPort.Modes will be HIRES+LACE (with perhaps some "special" bits also set for future improvement), but with dimensions equal to the actual A2024-mode Workbench screen. This will favor programs which open windows on the A2024 Workbench, but will cause some problems for programs which try to "clone" the Workbench screen using this function.
If you want the real information about the modern Workbench screen, call LockPubScreen('Workbench') and acquire its display mode ID by inquiring of the actual ViewPort (using GetVPModeID()).
You may then use the information you get to clone as many of the properties of the Workbench screen that you wish.
In the long run, it's probably better to provide your user with a screen mode selection option, and skip all this.
|
Open an Intuition window. |
|
|
Prevent a public screen from closing. |
|
|
Get the 32 bit DisplayID from a ViewPort. |
|
|
Establish global public screen behavior. |
|
|
Open an Intuition screen |