The first parameter determines the action that this function should take. In
the actions I discuss here, the second and fourth parameters aren't used. You
can enter 0 (zero) for these parameters. The third parameter, however, is a
pointer to the variable that the result of this function should be stored in.
If e.g. you want to know if the system beep is set, then you can use the
following:
SystemParametersInfo(SPI_GETBEEP, 0, @BeepSet,
0);
Make sure that BeepSet is defined as a boolean. There are some other actions
which also require a boolean as the third parameter.
SPI_GETDRAGFULLWINDOWS - Determines whether dragging of full windows is set
or not. This function is only supported on Windows 95 when Windows Plus has been
installed.
SPI_GETFONTSMOOTHING - When the font smoothing is enabled, then this action
returns truw. Font smoothing is only available on Windows 95 when Windows PLus
has been installed.
SPI_GETSCREENSAVEACTIVE - Tells you whether the screensaver is active or not.
There are also actions that require the third parameter to be a pointer to an
integer. Like these:
SPI_GETBORDER - This gets the width of a window's sizing border.
SPI_GETSCREENSAVETIMEOUT - Indicates the screensaver time-out value, in
seconds.
You could then create the following function to get to know the screensaver
time-out:
function GetScreenSaveTimeOut: integer;
begin
SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0,
@Result, 0);
end;
Same for a boolean, just change "integer" in the function to "boolean".
You can also find out whether Windows Plus has been installed using the
SystemParametersInfo function, but it works a little bit different.
PlusInstalled :=
SystemParametersInfo(SPI_GETWINDOWSEXTENSION, 1, 0, 0);
Make sure you have defined PlusInstalled as a boolean.
This tip is partially based on Lennie De Villiers tip of February 8th, 2000,
about finding out whether the screen saver is active.
|