Index: trunk/src/user32/initterm.cpp
===================================================================
--- trunk/src/user32/initterm.cpp	(revision 1377)
+++ trunk/src/user32/initterm.cpp	(revision 1378)
@@ -1,3 +1,3 @@
-/* $Id: initterm.cpp,v 1.11 1999-10-20 13:46:25 sandervl Exp $ */
+/* $Id: initterm.cpp,v 1.12 1999-10-20 16:27:00 cbratschi Exp $ */
 
 /*
@@ -40,4 +40,5 @@
 #include "heapshared.h"
 #include "win32wdesktop.h"
+#include "syscolor.h"
 
 /*-------------------------------------------------------------------*/
@@ -82,6 +83,6 @@
          CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed  98-03-18 05:28:48*/
 
-	 if(RegisterLxDll(hModule, 0, 0) == FALSE) 
-		return 0UL;
+         if(RegisterLxDll(hModule, 0, 0) == FALSE)
+                return 0UL;
 
          /*******************************************************************/
@@ -101,6 +102,6 @@
          InitSpyQueue();
 
-	 if(InitializeSharedHeap() == FALSE) 
-		return 0UL;
+         if(InitializeSharedHeap() == FALSE)
+                return 0UL;
 
          //SvL: Init win32 PM classes
@@ -113,12 +114,12 @@
          RegisterSystemClasses(hModule);
 
-	 //SvL: Create Desktop Window
-	 if(CreateWin32Desktop() == FALSE) {
+         //SvL: Create Desktop Window
+         if(CreateWin32Desktop() == FALSE) {
                 return 0UL;
-	 }
+         }
 
          break;
       case 1 :
-	 UnregisterLxDll(hModule);
+         UnregisterLxDll(hModule);
          break;
       default  :
@@ -141,4 +142,5 @@
 {
    dprintf(("user32 exit\n"));
+   SYSCOLOR_Save();
    DestroyDesktopWindow();
    UnregisterSystemClasses();
Index: trunk/src/user32/scroll.cpp
===================================================================
--- trunk/src/user32/scroll.cpp	(revision 1377)
+++ trunk/src/user32/scroll.cpp	(revision 1378)
@@ -1,3 +1,3 @@
-/* $Id: scroll.cpp,v 1.11 1999-10-18 10:54:03 sandervl Exp $ */
+/* $Id: scroll.cpp,v 1.12 1999-10-20 16:27:00 cbratschi Exp $ */
 /*
  * Scrollbar control
@@ -703,17 +703,17 @@
         return;
     }
-    if(nBar == SB_VERT) 
-    {
-    	hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getVertScrollHandle());
-    }
-    else 
+    if(nBar == SB_VERT)
+    {
+        hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getVertScrollHandle());
+    }
+    else
     if(nBar == SB_HORZ)
     {
-	hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getHorzScrollHandle());
+        hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getHorzScrollHandle());
     }
     else hwndScroll = hwnd;
 
     if(hwndScroll == 0)
-	return;
+        return;
 
     hdc = GetDCEx( hwndScroll, 0, DCX_CACHE | ((nBar == SB_CTL) ? 0 : DCX_WINDOW));
@@ -1151,7 +1151,7 @@
             CONV_POINT16TO32( (POINT16 *)&lParam, &pt );
             SCROLL_HandleScrollEvent( hwnd, SB_HORZ, message, pt );
-	    if(message == WM_MOUSEMOVE) {
-		return 1; //SvL: Let PM change the mouse cursor to the default
-	    }
+            if(message == WM_MOUSEMOVE) {
+                return 1; //SvL: Let PM change the mouse cursor to the default
+            }
         }
         break;
@@ -1229,7 +1229,7 @@
             CONV_POINT16TO32( (POINT16 *)&lParam, &pt );
             SCROLL_HandleScrollEvent( hwnd, SB_VERT, message, pt );
-	    if(message == WM_MOUSEMOVE) {
-		return 1; //SvL: Let PM change the mouse cursor to the default
-	    }
+            if(message == WM_MOUSEMOVE) {
+                return 1; //SvL: Let PM change the mouse cursor to the default
+            }
         }
         break;
Index: trunk/src/user32/syscolor.cpp
===================================================================
--- trunk/src/user32/syscolor.cpp	(revision 1377)
+++ trunk/src/user32/syscolor.cpp	(revision 1378)
@@ -1,3 +1,3 @@
-/* $Id: syscolor.cpp,v 1.9 1999-10-09 11:03:23 sandervl Exp $ */
+/* $Id: syscolor.cpp,v 1.10 1999-10-20 16:27:01 cbratschi Exp $ */
 
 /*
@@ -21,4 +21,5 @@
 #include "user32.h"
 #include "syscolor.h"
+#include "options.h"
 
 //SvL: Open32 colors are much better than those in the table below
@@ -26,4 +27,6 @@
 
 #define NUM_SYS_COLORS     (COLOR_GRADIENTINACTIVECAPTION+1)
+
+BOOL USEWINCOLORS = PROFILE_GetOdinIniBool(ODINCOLORS,"UseWinColors",FALSE);
 
 /* Win98 colors */
@@ -59,5 +62,38 @@
   RGB(0,0,255),     //COLOR_HOTLIGHT
   RGB(16,136,208),  //COLOR_GRADIENTACTIVECAPTION
-  RGB(16,136,208)        //COLOR_GRADIENTINACTIVECAPTION
+  RGB(16,136,208)   //COLOR_GRADIENTINACTIVECAPTION
+};
+
+static char* ColorNames[NUM_SYS_COLORS] =
+{
+  "SCROLLBAR",
+  "COLOR_BACKGROUND",
+  "ACTIVECAPTION",
+  "INACTIVECAPTION",
+  "MENU",
+  "WINDOW",
+  "WINDOWFRAME",
+  "MENUTEXT",
+  "WINDOWTEXT",
+  "CAPTIONTEXT",
+  "ACTIVEBORDER",
+  "INACTIVEBORDER",
+  "APPWORKSPACE",
+  "HIGHLIGHT",
+  "HIGHLIGHTTEXT",
+  "BTNFACE",
+  "BTNSHADOW",
+  "GRAYTEXT",
+  "BTNTEXT",
+  "INACTIVECAPTIONTEXT",
+  "BTNHIGHLIGHT",
+  "3DDKSHADOW",
+  "3DLIGHT",
+  "INFOTEXT",
+  "INFOBK",
+  "ALTERNATEBTNFACE",
+  "COLOR_HOTLIGHT",
+  "GRADIENTACTIVECAPTION",
+  "GRADIENTINACTIVECAPTION"
 };
 
@@ -84,16 +120,18 @@
 void SYSCOLOR_Load(void)
 {
-/* CB: load colors from Odin ini file
-    int i, r, g, b;
-    const char * const *p;
-    char buffer[100];
-
-    for (i = 0, p = DefSysColors; i < NUM_SYS_COLORS; i++, p += 2)
-    {
-        if (sscanf(p[1], " %d %d %d", &r, &g, &b ) != 3) r = g = b = 0;
-        SYSCOLOR_SetColor( i, RGB(r,g,b) );
-    }
-*/
-
+  int i, r, g, b;
+  const char * const *p;
+  char buffer[100];
+
+  if (PROFILE_GetOdinIniBool(ODINCOLORS,"SaveColors",FALSE))
+  {
+    for (i = 0,p = ColorNames; i < NUM_SYS_COLORS; i++, p++)
+    {
+      if (PROFILE_GetOdinIniString(ODINCOLORS,(LPCSTR)*p,"",buffer,sizeof(buffer)))
+      {
+        if (sscanf(buffer,"%d %d %d",&r,&g,&b) == 3) SysColors[i] = RGB(r,g,b);
+      }
+    }
+  }
 }
 //******************************************************************************
@@ -101,5 +139,20 @@
 void SYSCOLOR_Save(void)
 {
-  //CB: todo
+  INT x;
+  const char * const *p;
+  char buffer[100];
+
+  if (!fColorInit) return;
+
+  if (PROFILE_GetOdinIniBool(ODINCOLORS,"SaveColors",FALSE))
+  {
+    for (x = 0,p = ColorNames;x < NUM_SYS_COLORS;x++,p++)
+    {
+      INT color = SysColors[x];
+
+      sprintf(buffer,"%d %d %d",color & 0xFF,(color & 0xFF00) >> 8,(color & 0xFF0000) >> 16);
+      PROFILE_SetOdinIniString(ODINCOLORS,(LPCSTR)*p,(LPCSTR)buffer);
+    }
+  }
 }
 //******************************************************************************
@@ -110,8 +163,11 @@
 
   SYSCOLOR_Load();
-  for (x = 0;x < NUM_SYS_COLORS;x++) {
-	if(x < NUM_OPEN32_SYSCOLORS)
-		SYSCOLOR_SetColor(x,O32_GetSysColor(x));
-	else	SYSCOLOR_SetColor(x,SysColors[x]);
+  if (USEWINCOLORS)
+    for (x = 0;x < NUM_SYS_COLORS;x++) SYSCOLOR_SetColor(x,SysColors[x]);
+  else
+    for (x = 0;x < NUM_SYS_COLORS;x++) {
+        if(x < NUM_OPEN32_SYSCOLORS)
+                SYSCOLOR_SetColor(x,O32_GetSysColor(x));
+        else    SYSCOLOR_SetColor(x,SysColors[x]);
   }
 }
@@ -126,9 +182,11 @@
   }
 
-  if (nIndex >= 0 && nIndex < NUM_SYS_COLORS) 
-  {
-	if(nIndex < NUM_OPEN32_SYSCOLORS)
-		return O32_GetSysColor(nIndex);
-	else	return SysColors[nIndex];
+  if (nIndex >= 0 && nIndex < NUM_SYS_COLORS)
+  {
+    if (USEWINCOLORS) return SysColors[nIndex];
+    else
+        if(nIndex < NUM_OPEN32_SYSCOLORS)
+                return O32_GetSysColor(nIndex);
+        else    return SysColors[nIndex];
   }
   else return 0;
@@ -150,5 +208,5 @@
     WriteLog("OS2SetSysColors\n");
 #endif
-    
+
     O32_SetSysColors(nChanges, lpSysColor, lpColorValues);
 
Index: trunk/src/user32/syscolor.h
===================================================================
--- trunk/src/user32/syscolor.h	(revision 1377)
+++ trunk/src/user32/syscolor.h	(revision 1378)
@@ -1,3 +1,3 @@
-/* $Id: syscolor.h,v 1.5 1999-10-05 16:02:53 cbratschi Exp $ */
+/* $Id: syscolor.h,v 1.6 1999-10-20 16:27:01 cbratschi Exp $ */
 
 /*
@@ -35,4 +35,5 @@
 
 extern void SYSCOLOR_Init(void);
+extern void SYSCOLOR_Save(void);
 
 #endif  /* __WINE_SYSCOLOR_H */
