More Visual Prolog 7.3 Examples


System Colors Handling

Written by Jose A. Becerril



The example:

  • Creates a standard Visual Prolog Task window with three buttons and two menu items.
  • The menu items produce a window and a dialogue with a colored background.
  • Two buttons change a part or all the colors in the Windows system.
  • The third button restores all colors to their original state.
  • A "safety device" restores colors if you close the application. (In any case, the changes are only permanent until log off or reboot).

What you can experiment: (in

  • Call Windows APIs using : 
     getSysColor    externally ,
     setSysColors   externally
  • Check the way I use an API, which originally points to two arrays:
        Punto = memory::allocHeap(sizeOfDomain(binary)),
        BI = uncheckedConvert(binary, Punto),
        binary::setIndexed_integer32(BI, 0,Item),
         Value= uncheckedConvert( core::integer32, BI ),
   % ......................................................................................
  Punto2 = memory::allocHeap(sizeOfDomain(binary)),
                BI2 = uncheckedConvert(binary, Punto2),
  binary::setIndexed_integer32(BI2, 0,Colour),
  Value2 = uncheckedConvert( core::integer32, BI2 ),
  • See how to call a window or a dialog changing a background color (in NewWindows
        onUpdate(Rectangle) = defaultHandling():-
        vpi::winClear( thisWin,Rectangle,0xFF80FF),!.
  • See how to get the original color values and store them in a dba  to recover them later. (in
storing_Colour: colores::pairList:=[].


Download the project



The example requires Visual Prolog 7.3 Commercial Edition.


If you use the Personal Edition, but need the  features supported only in the Commercial Edition, you are welcome to order the latest build of this Edition just now: Order!


Users of previous versions of Visual Prolog are welcome to upgrade to the current version of Visual Prolog  to use the latest versions of the Visual Prolog examples.


Download VIP-ALC'08

Visual Prolog Application & Language Conference (VIP-ALC 2006) April 24-26 2006

Download VIP-ALC'06 Proceedings