home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************/
- /* */
- /* Amiga C Encyclopedia (ACE) V3.0 Amiga C Club (ACC) */
- /* ------------------------------- ------------------ */
- /* */
- /* Book: ACM Intuition Amiga C Club */
- /* Chapter: Miscellaneous Tulevagen 22 */
- /* File: Example3.c 181 41 LIDINGO */
- /* Author: Anders Bjerin SWEDEN */
- /* Date: 92-05-01 */
- /* Version: 1.10 */
- /* */
- /* Copyright 1992, Anders Bjerin - Amiga C Club (ACC) */
- /* */
- /* Registered members may use this program freely in their */
- /* own commercial/noncommercial programs/articles. */
- /* */
- /***********************************************************/
-
- /* This example shows how to get a copy of the preferences. */
-
-
- #include <intuition/intuition.h>
-
-
-
- struct IntuitionBase *IntuitionBase;
-
-
-
- main()
- {
- /* Declare a preferences structure: */
- struct Preferences pref;
-
-
-
- /* Open the Intuition Library: */
- IntuitionBase = (struct IntuitionBase *)
- OpenLibrary( "intuition.library", 0 );
-
- if( IntuitionBase == NULL )
- exit(); /* Could NOT open the Intuition Library! */
-
-
-
- /* Try to get a copy of the current preferences (whole): */
- if( GetPrefs( &pref, sizeof(pref) ) == NULL )
- {
- /* Could not get a copy of the preferences! */
- CloseLibrary( IntuitionBase );
- exit();
- }
-
-
-
- /* We have now a copy of the preferences. */
- /* Do what ever you want... */
-
- /* Why not print out the workbench clours? */
- printf( "\nWorkbench Screen Colours:\n");
- printf( " RGB\n" );
- printf( "Colour 0: 0x%04x\n", pref.color0 );
- printf( "Colour 1: 0x%04x\n", pref.color1 );
- printf( "Colour 2: 0x%04x\n", pref.color2 );
- printf( "Colour 3: 0x%04x\n\n", pref.color3 );
-
-
-
- /* Close the Intuition Library: */
- CloseLibrary( IntuitionBase );
- }
-
-