Index: trunk/src/kernel32/conprop.cpp
===================================================================
--- trunk/src/kernel32/conprop.cpp	(revision 15)
+++ trunk/src/kernel32/conprop.cpp	(revision 16)
@@ -1,9 +1,2 @@
-/* $Id: conprop.cpp,v 1.2 1999-05-25 19:29:30 phaller Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
 /*
  * Win32 Console API Translation for OS/2
@@ -11,5 +4,5 @@
  * 1998/03/06 Patrick Haller (haller@zebra.fh-weingarten.de)
  *
- * @(#) conprop.cpp         1.0.0   1998/03/06 PH Start from scratch
+ * @(#) conprop.cpp     	1.0.0   1998/03/06 PH Start from scratch
  */
 
@@ -237,4 +230,5 @@
                        MB_OK | MB_MOVEABLE );
   free( szMsg );
+  return;
 }
 
@@ -269,5 +263,9 @@
       PCONSOLEOPTIONS pConsoleOptions = (PCONSOLEOPTIONS)mp2;    /* save ptr */
       HWND            hwndNotebook;                /* notebook window handle */
-
+      
+      
+      /* @@@PH we should work on a copy of the console options for */
+      /* UNDO and APPLY to work properly */
+      
       WinSetWindowULong (hwnd,            /* store the data pointer in local */
                          QWL_USER,        /* variable storage attached to the*/
@@ -280,5 +278,5 @@
                                       PAGE_COUNT(nbpage),
                                       (PVOID)NULL);
-
+      
       /* this message makes the client pages to write new values into their  */
       /* controls.                                                           */
@@ -289,5 +287,5 @@
                       BMSG_SEND |
                       BMSG_DESCENDANTS);
-
+      
       return ((MPARAM)FALSE);
     }
@@ -301,9 +299,9 @@
     {
       PCONSOLEOPTIONS pConsoleOptions;      /* the console options structure */
-
+      
       pConsoleOptions = (PCONSOLEOPTIONS)
                         WinQueryWindowULong(hwnd,  /* query pointer from wnd */
                                             QWL_USER);
-
+      
       switch (SHORT1FROMMP(mp1))
       {
@@ -317,17 +315,18 @@
                           BMSG_DESCENDANTS);
           return ( (MPARAM) FALSE);
-
-
+        
+        case ID_BTN_SAVE:
+          /* @@@PH save console option work buffer */
+          /* @@@PH ConsolePropertyWrite(pConsoleOptions) */
+          WinDismissDlg(hwnd,
+                        ID_BTN_SAVE);
+          return ( (MPARAM) FALSE);        
+        
         case ID_BTN_APPLY:
-          WinBroadcastMsg(hwnd,                  /* broadcast to all dialogs */
-                          UM_PROPERTY_APPLY,
-                          (MPARAM)pConsoleOptions,
-                          (MPARAM)NULL,
-                          BMSG_SEND |
-                          BMSG_DESCENDANTS);
-        /*  WinDismissDlg(hwnd,
-                        ID_BTN_APPLY);*/
+          /* @@@PH save console option work buffer */
+          WinDismissDlg(hwnd,
+                        ID_BTN_APPLY);
           return ( (MPARAM) FALSE);
-
+      
         case BS_HELP:
           return ( (MPARAM) FALSE);
@@ -335,5 +334,5 @@
     }
   }
-
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1030,20 +1029,20 @@
      * user messages                                                         *
      *************************************************************************/
-
+    
     case UM_PROPERTY_UNDO:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       ConPropPage1Set(hwnd,                                    /* set values */
                       pOpt);
-
+      
       return ( (MPARAM) FALSE);
     }
-
-
+    
+    
     case UM_PROPERTY_APPLY:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd,
                                                  CB_CONSOLE_CLOSEWINDOWONEXIT);
@@ -1054,5 +1053,5 @@
       pOpt->fToolbarActive          = WinQueryButtonCheckstate(hwnd,
                                                            CB_CONSOLE_TOOLBAR);
-
+      
       WinSendDlgItemMsg(hwnd,                             /* query the value */
                         SPN_CONSOLE_TAB,
@@ -1061,5 +1060,5 @@
                         MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)
                         );
-
+        
       WinSendDlgItemMsg(hwnd,                             /* query the value */
                         SPN_CONSOLE_CURSORBLINK,
@@ -1068,10 +1067,10 @@
                         MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE)
                        );
-
+      
       return ( (MPARAM) FALSE);
     }
   }
-
-
+  
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1102,31 +1101,67 @@
   switch (ulMessage)
   {
+    case WM_COMMAND:
+    {
+      PCONSOLEOPTIONS pConsoleOptions;      /* the console options structure */
+      HWND            hwndNotebook = WinQueryWindow(WinQueryWindow(hwnd,
+                                                                   QW_PARENT),
+                                                    QW_PARENT);
+      
+      pConsoleOptions = (PCONSOLEOPTIONS)          /* query pointer from wnd */
+                        WinQueryWindowULong(hwndNotebook,
+                                            QWL_USER);
+      
+      switch (SHORT1FROMMP(mp1))
+      {
+        case ID_BTN_SPEAKERTEST:
+          /* test speaker */
+          DosBeep(pConsoleOptions->ulSpeakerFrequency,
+                  pConsoleOptions->ulSpeakerDuration);
+        
+          return ( (MPARAM) FALSE);
+      }
+    }
+    
+    
     /*************************************************************************
      * user messages                                                         *
      *************************************************************************/
-
+    
     case UM_PROPERTY_UNDO:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       ConPropPage2Set(hwnd,                                    /* set values */
                       pOpt);
-
+      
       return ( (MPARAM) FALSE);
     }
-
-
+    
+    
     case UM_PROPERTY_APPLY:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
-//      pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd,
-//                                                 CB_CONSOLE_CLOSEWINDOWONEXIT);
-
+      
+      pOpt->fSpeakerEnabled    = WinQueryButtonCheckstate(hwnd,
+                                                          CB_CONSOLE_SPEAKERENABLE);
+      pOpt->ulSpeakerDuration  = (ULONG)WinSendDlgItemMsg(hwnd,
+                                                          SLB_CONSOLE_SPEAKERDURATION,
+                                                          SLM_QUERYSLIDERINFO,
+                                                          MPFROM2SHORT(SMA_SLIDERARMPOSITION,
+                                                                       SMA_INCREMENTVALUE),
+                                                          NULL);
+        
+      pOpt->ulSpeakerFrequency = (ULONG)WinSendDlgItemMsg(hwnd,
+                                                          SLB_CONSOLE_SPEAKERFREQUENCY,
+                                                          SLM_QUERYSLIDERINFO,
+                                                          MPFROM2SHORT(SMA_SLIDERARMPOSITION,
+                                                                       SMA_INCREMENTVALUE),
+                                                          NULL);
+      
       return ( (MPARAM) FALSE);
     }
   }
-
-
+  
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1160,28 +1195,28 @@
      * user messages                                                         *
      *************************************************************************/
-
+    
     case UM_PROPERTY_UNDO:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       ConPropPage3Set(hwnd,                                    /* set values */
                       pOpt);
-
+      
       return ( (MPARAM) FALSE);
     }
-
-
+    
+    
     case UM_PROPERTY_APPLY:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
 //      pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd,
 //                                                 CB_CONSOLE_CLOSEWINDOWONEXIT);
-
+      
       return ( (MPARAM) FALSE);
     }
   }
-
-
+  
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1215,28 +1250,61 @@
      * user messages                                                         *
      *************************************************************************/
-
+    
     case UM_PROPERTY_UNDO:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       ConPropPage4Set(hwnd,                                    /* set values */
                       pOpt);
-
+      
       return ( (MPARAM) FALSE);
     }
-
-
+    
+    
     case UM_PROPERTY_APPLY:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
-//      pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd,
-//                                                 CB_CONSOLE_CLOSEWINDOWONEXIT);
-
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_X,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordDefaultPosition.X),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_Y,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordDefaultPosition.Y),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_DEFAULTWIDTH,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordDefaultSize.X),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_DEFAULTHEIGHT,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordDefaultSize.Y),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_BUFFERWIDTH,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordBufferSize.X),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_BUFFERHEIGHT,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->coordBufferSize.Y),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
       return ( (MPARAM) FALSE);
     }
   }
-
-
+  
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1270,28 +1338,55 @@
      * user messages                                                         *
      *************************************************************************/
-
+    
     case UM_PROPERTY_UNDO:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
+      
       ConPropPage5Set(hwnd,                                    /* set values */
                       pOpt);
-
+      
       return ( (MPARAM) FALSE);
     }
-
-
+    
+    
     case UM_PROPERTY_APPLY:
     {
       PCONSOLEOPTIONS pOpt = (PCONSOLEOPTIONS)mp1;            /* get pointer */
-
-//      pOpt->fTerminateAutomatically = WinQueryButtonCheckstate(hwnd,
-//                                                 CB_CONSOLE_CLOSEWINDOWONEXIT);
-
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_UPDATELIMIT,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->ulUpdateLimit),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_CONSOLEPRIORITY,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->ulConsoleThreadPriorityClass),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_CONSOLEPRIODELTA,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->ulConsoleThreadPriorityDelta),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_APPPRIORITY,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->ulAppThreadPriorityClass),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
+      WinSendDlgItemMsg(hwnd,                             /* query the value */
+                        SPN_CONSOLE_APPPRIODELTA,
+                        SPBM_QUERYVALUE,
+                        MPFROMP(&pOpt->ulAppThreadPriorityDelta),
+                        MPFROM2SHORT(0,SPBQ_ALWAYSUPDATE));      
+      
       return ( (MPARAM) FALSE);
     }
   }
-
-
+  
+  
   return WinDefDlgProc(hwnd,                   /* default message processing */
                        ulMessage,
@@ -1371,5 +1466,5 @@
  * Name      : static APIRET ConPropPage1Set
  * Funktion  : setup dialog elements for page 1
- * Parameter :
+ * Parameter : 
  * Variablen :
  * Ergebnis  : MRESULT
@@ -1384,5 +1479,5 @@
   if (pConsoleOptions == NULL)                           /* check parameters */
     return (ERROR_INVALID_PARAMETER);               /* raise error condition */
-
+  
   WinCheckButton(hwndDlg,                                /* auto-termination */
                  CB_CONSOLE_CLOSEWINDOWONEXIT,
@@ -1392,13 +1487,13 @@
                  CB_CONSOLE_INSERTMODE,
                  pConsoleOptions->fInsertMode);
-
+  
   WinCheckButton(hwndDlg,                               /* quick insert mode */
                  CB_CONSOLE_QUICKINSERT,
                  pConsoleOptions->fQuickInsert);
-
+  
   WinCheckButton(hwndDlg,                                 /* console toolbar */
                  CB_CONSOLE_TOOLBAR,
                  pConsoleOptions->fToolbarActive);
-
+  
                        /* set spin limits for the SPN_CONSOLE_TAB spinbutton */
   WinSendDlgItemMsg(hwndDlg,
@@ -1407,5 +1502,5 @@
                     MPFROMSHORT(80),
                     MPFROMSHORT(0));
-
+  
   WinSendDlgItemMsg (hwndDlg,                           /* set current value */
                      SPN_CONSOLE_TAB,
@@ -1420,5 +1515,5 @@
                     MPFROMSHORT(100),
                     MPFROMSHORT(1));
-
+  
   WinSendDlgItemMsg (hwndDlg,                           /* set current value */
                      SPN_CONSOLE_CURSORBLINK,
@@ -1426,5 +1521,5 @@
                      MPFROMLONG(pConsoleOptions->ucCursorDivisor),
                      0);
-
+    
   return (NO_ERROR);                                                   /* OK */
 }
@@ -1433,5 +1528,5 @@
  * Name      : static APIRET ConPropPage2Set
  * Funktion  : setup dialog elements for page 2
- * Parameter :
+ * Parameter : 
  * Variablen :
  * Ergebnis  : MRESULT
@@ -1450,9 +1545,9 @@
   if (pConsoleOptions == NULL)                           /* check parameters */
     return (ERROR_INVALID_PARAMETER);               /* raise error condition */
-
+  
   WinCheckButton(hwndDlg,                                /* Enable speaker */
                  CB_CONSOLE_SPEAKERENABLE,
                  pConsoleOptions->fSpeakerEnabled);
-
+  
   /* frequency slider */
   slcd.cbSize = sizeof(SLDCDATA);
@@ -1462,5 +1557,5 @@
                     SLB_CONSOLE_SPEAKERFREQUENCY,
                     WM_QUERYWINDOWPARAMS,
-                    (MPARAM)&wp,
+                    (MPARAM)&wp, 
                     NULL);
 
@@ -1471,5 +1566,5 @@
                     SLB_CONSOLE_SPEAKERFREQUENCY,
                     WM_SETWINDOWPARAMS,
-                    (MPARAM)&wp,
+                    (MPARAM)&wp, 
                     NULL);
 
@@ -1479,5 +1574,5 @@
                     MPFROM2SHORT(SMA_SETALLTICKS, 40),
                     NULL);
-
+  
   /* duration slider */
   slcd.cbSize = sizeof(SLDCDATA);
@@ -1487,5 +1582,5 @@
                     SLB_CONSOLE_SPEAKERDURATION,
                     WM_QUERYWINDOWPARAMS,
-                    (MPARAM)&wp,
+                    (MPARAM)&wp, 
                     NULL);
 
@@ -1496,5 +1591,5 @@
                     SLB_CONSOLE_SPEAKERDURATION,
                     WM_SETWINDOWPARAMS,
-                    (MPARAM)&wp,
+                    (MPARAM)&wp, 
                     NULL);
 
@@ -1504,6 +1599,6 @@
                     MPFROM2SHORT(SMA_SETALLTICKS, 40),
                     NULL);
-
-
+  
+  
   return (NO_ERROR);                                                   /* OK */
 }
@@ -1512,5 +1607,5 @@
  * Name      : static APIRET ConPropPage3Set
  * Funktion  : setup dialog elements for page 3
- * Parameter :
+ * Parameter : 
  * Variablen :
  * Ergebnis  : MRESULT
@@ -1552,5 +1647,5 @@
                     MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN)-1),
                     MPFROMSHORT(0));
-
+  
   WinSendDlgItemMsg(hwndDlg,
                     SPN_CONSOLE_DEFAULTHEIGHT,
@@ -1558,8 +1653,21 @@
                     MPFROMSHORT(WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN)-1),
                     MPFROMSHORT(0));
-
+  
+  WinSendDlgItemMsg(hwndDlg,
+                    SPN_CONSOLE_BUFFERWIDTH,
+                    SPBM_SETLIMITS,
+                    MPFROMSHORT(9999),
+                    MPFROMSHORT(0));
+  
+  WinSendDlgItemMsg(hwndDlg,
+                    SPN_CONSOLE_BUFFERHEIGHT,
+                    SPBM_SETLIMITS,
+                    MPFROMSHORT(9999),
+                    MPFROMSHORT(0));
+  
+  
   /* setup active values */
 
-  WinSendDlgItemMsg(hwndDlg,
+  WinSendDlgItemMsg(hwndDlg,                        
                     SPN_CONSOLE_X,
                     SPBM_SETCURRENTVALUE,
@@ -1567,5 +1675,5 @@
                     0);
 
-  WinSendDlgItemMsg(hwndDlg,
+  WinSendDlgItemMsg(hwndDlg,                        
                     SPN_CONSOLE_Y,
                     SPBM_SETCURRENTVALUE,
@@ -1573,16 +1681,29 @@
                     0);
 
-  WinSendDlgItemMsg(hwndDlg,
+  WinSendDlgItemMsg(hwndDlg,                        
                     SPN_CONSOLE_DEFAULTWIDTH,
                     SPBM_SETCURRENTVALUE,
-                    MPFROMLONG(pConsoleOptions->coordDefaultPosition.X),
+                    MPFROMLONG(pConsoleOptions->coordDefaultSize.X),
                     0);
 
-  WinSendDlgItemMsg(hwndDlg,
+  WinSendDlgItemMsg(hwndDlg,                        
                     SPN_CONSOLE_DEFAULTHEIGHT,
                     SPBM_SETCURRENTVALUE,
-                    MPFROMLONG(pConsoleOptions->coordDefaultPosition.Y),
+                    MPFROMLONG(pConsoleOptions->coordDefaultSize.Y),
                     0);
-
+  
+  WinSendDlgItemMsg(hwndDlg,                        
+                    SPN_CONSOLE_BUFFERWIDTH,
+                    SPBM_SETCURRENTVALUE,
+                    MPFROMLONG(pConsoleOptions->coordBufferSize.X),
+                    0);
+
+  WinSendDlgItemMsg(hwndDlg,                        
+                    SPN_CONSOLE_BUFFERHEIGHT,
+                    SPBM_SETCURRENTVALUE,
+                    MPFROMLONG(pConsoleOptions->coordBufferSize.Y),
+                    0);
+  
+  
   return (NO_ERROR);                                                   /* OK */
 }
@@ -1592,5 +1713,5 @@
  * Name      : static APIRET ConPropPage4Set
  * Funktion  : setup dialog elements for page 4
- * Parameter :
+ * Parameter : 
  * Variablen :
  * Ergebnis  : MRESULT
@@ -1606,5 +1727,5 @@
   ULONG ulRow;
   ULONG ulColumn;
-
+  
 #define MAX_TRANSCOLORS 16
   static const ULONG TabColorTranslation[MAX_TRANSCOLORS] =
@@ -1627,11 +1748,11 @@
     /* 16 */ 0x00ffffff
   };
-
+  
 
   if (pConsoleOptions == NULL)                           /* check parameters */
     return (ERROR_INVALID_PARAMETER);               /* raise error condition */
-
+ 
   /* setup the value sets */
-  for (ulColor = 0;
+  for (ulColor = 0; 
        ulColor < MAX_TRANSCOLORS;
        ulColor++)
@@ -1677,5 +1798,5 @@
  * Name      : static APIRET ConPropPage5Set
  * Funktion  : setup dialog elements for page 5
- * Parameter :
+ * Parameter : 
  * Variablen :
  * Ergebnis  : MRESULT
@@ -1720,5 +1841,5 @@
                     MPFROMSHORT(0));
 
-
+  
   WinSendDlgItemMsg(hwndDlg,                           /* set current value */
                     SPN_CONSOLE_APPPRIODELTA,
@@ -1747,5 +1868,5 @@
                     MPFROMSHORT(0));
 
-
+  
   WinSendDlgItemMsg(hwndDlg,                           /* set current value */
                     SPN_CONSOLE_CONSOLEPRIODELTA,
@@ -1771,63 +1892,28 @@
 
 #if 0
-typedef struct _Options
-{
-  HMODULE hmodResources;                   /* module handle for PM resources */
-
-  BOOL  fSpeakerEnabled;               /* whether we process BEL 0x07 or not */
-  ULONG ulSpeakerDuration;        /* duration and frequency for speaker beep */
-  ULONG ulSpeakerFrequency;
-  ULONG ulUpdateLimit;        /* when exceeding this line counter, automatic */
-                                               /* screen update is performed */
-
-  BOOL  fSetWindowPosition;           /* TRUE if window has to be positioned */
-
-  COORD coordDefaultPosition;
-  COORD coordDefaultSize;
-
-  BOOL  fMouseActions;                  /* like Warp 4's "mouse action" mode */
-
-  UCHAR ucDefaultAttribute;                    /* the default text attribute */
-
-  ULONG ulConsoleThreadPriorityClass;       /* priority settings for message */
-  ULONG ulConsoleThreadPriorityDelta;                              /* thread */
-} CONSOLEOPTIONS, *PCONSOLEOPTIONS;
-
-
-DLGTEMPLATE DLG_CONSOLE_PAGE1
-  CONTROL "~Close window on exit", CB_CONSOLE_CLOSEWINDOWONEXIT, 5, 78, 196, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Insert mode enabled", CB_CONSOLE_INSERTMODE, 5, 62, 196, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Quickinsert enabled", CB_CONSOLE_QUICKINSERT, 5, 46, 196, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Console ~toolbar", CB_CONSOLE_TOOLBAR, 5, 30, 196, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "tabwidth", SPN_CONSOLE_TAB, 122, 4, 55, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Tabulator ~width:", -1, 5, 4, 112, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "tabwidth", SPN_CONSOLE_CURSORBLINK, 122, 17, 55, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Cursor blink ~frequency:", -1, 5, 17, 112, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-
-DLGTEMPLATE DLG_CONSOLE_PAGE2
-  CONTROL "~Enable speaker", CB_CONSOLE_SPEAKERENABLE, 6, 71, 195, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Speaker frequency", SLB_CONSOLE_SPEAKERFREQUENCY, 92, 52, 111, 16, WC_SLIDER, SLS_HORIZONTAL | SLS_CENTER | SLS_HOMELEFT | SLS_PRIMARYSCALE1 | SLS_SNAPTOINCREMENT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Speaker duration", SBL_CONSOLE_SPEAKERDURATION, 92, 35, 111, 16, WC_SLIDER, SLS_HORIZONTAL | SLS_CENTER | SLS_HOMELEFT | SLS_PRIMARYSCALE1 | SLS_SNAPTOINCREMENT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-
-DLGTEMPLATE DLG_CONSOLE_PAGE3
-  CONTROL "Sample", SPN_CONSOLE_X, 49, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Sample", SPN_CONSOLE_Y, 49, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Width:", -1, 118, 60, 30, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "Sample", 102, 155, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Height:", -1, 119, 45, 30, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "Sample", 104, 155, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Override default position and size", CB_CONSOLE_WINDOWPOSITION, 8, 80, 155, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Console buffer", -1, 2, 1, 205, 39, WC_STATIC, SS_GROUPBOX | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "~Width:", 101, 8, 19, 30, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "Sample", 103, 49, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "~Height:", 105, 119, 19, 30, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
-  CONTROL "Sample", 106, 155, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-
-DLGTEMPLATE DLG_CONSOLE_PAGE5
-  CONTROL "Sample", SPN_CONSOLE_APPPRIORITY, 46, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_READONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Sample", SPN_CONSOLE_APPPRIODELTA, 154, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIORITY, 46, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIODELTA, 154, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
-  CONTROL "Sample", SPN_CONSOLE_UPDATELIMIT, 113, 5, 89, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+DLGTEMPLATE DLG_CONSOLE_PAGE3 
+   CONTROL "Sample", SPN_CONSOLE_X, 49, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_Y, 49, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_DEFAULTWIDTH, 155, 60, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_DEFAULTHEIGHT, 155, 45, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "~Override default position and size", CB_CONSOLE_WINDOWPOSITION, 8, 80, 155, 10, WC_BUTTON, BS_AUTOCHECKBOX | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_BUFFERWIDTH, 49, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_BUFFERHEIGHT, 155, 19, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_NUMERICONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Buffer allocates .. MB memory.", ST_CONSOLE_BUFFERMEMORY, 8, 6, 194, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
+
+DLGTEMPLATE DLG_CONSOLE_PAGE5 
+   CONTROL "Sample", SPN_CONSOLE_APPPRIORITY, 46, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_READONLY | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_APPPRIODELTA, 154, 52, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIORITY, 46, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_CONSOLEPRIODELTA, 154, 20, 48, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", SPN_CONSOLE_UPDATELIMIT, 113, 5, 89, 12, WC_SPINBUTTON, SPBS_MASTER | SPBS_ALLCHARACTERS | SPBS_JUSTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+
+DLGTEMPLATE DLG_CONSOLE_PAGE4 
+   CONTROL "...", VS_CONSOLE_FOREGROUND, 6, 56, 95, 34, WC_VALUESET, VS_RGB | VS_BORDER | VS_ITEMBORDER | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "...", VS_CONSOLE_BACKGROUND, 103, 56, 99, 34, WC_VALUESET, VS_RGB | VS_BORDER | VS_ITEMBORDER | WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "Sample", LB_CONSOLE_FONTS, 6, 4, 95, 36, WC_LISTBOX, WS_VISIBLE | WS_GROUP | WS_TABSTOP
+   CONTROL "00 x 00", ST_CONSOLE_WINDOWSIZE, 156, 16, 47, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
+   CONTROL "00 x 00", ST_CONSOLE_SCREENSIZE, 156, 4, 47, 8, WC_STATIC, SS_TEXT | DT_LEFT | DT_TOP | DT_MNEMONIC | WS_VISIBLE | WS_GROUP
+
 #endif
 
Index: trunk/src/kernel32/conprop.h
===================================================================
--- trunk/src/kernel32/conprop.h	(revision 15)
+++ trunk/src/kernel32/conprop.h	(revision 16)
@@ -1,9 +1,2 @@
-/* $Id: conprop.h,v 1.1 1999-05-24 20:19:43 ktk Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
 /*
  * Win32 Console Subsystem for OS/2
@@ -69,6 +62,7 @@
   BOOL  fSetWindowPosition;           /* TRUE if window has to be positioned */
 
-  COORD coordDefaultPosition;
-  COORD coordDefaultSize;
+  COORD coordDefaultPosition;      /* default position of the console window */
+  COORD coordDefaultSize;          /* default size     of the console window */
+  COORD coordBufferSize;           /* size of the console buffer             */
 
   BOOL  fQuickInsert;                         /* like NT's quick insert mode */
Index: trunk/src/kernel32/console.rc
===================================================================
--- trunk/src/kernel32/console.rc	(revision 15)
+++ trunk/src/kernel32/console.rc	(revision 16)
@@ -1,15 +1,2 @@
-/* $Id: console.rc,v 1.1 1999-05-24 20:19:45 ktk Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
-/*
- * Win32 Console Subsystem for OS/2
- *
- * 1998/03/06 PH Patrick Haller (haller@zebra.fh-weingarten.de)
- *
- */
 #ifndef WORKSHOP_INVOKED
   #include <os2.h>
@@ -36,8 +23,9 @@
 	DIALOG "Console Properties", 100, 6, 52, 262, 166, WS_VISIBLE, FCF_TITLEBAR | FCF_SYSMENU | FCF_NOBYTEALIGN
 	BEGIN
-		DEFPUSHBUTTON "~Undo", ID_BTN_UNDO, 52, 1, 51, 14
-		PUSHBUTTON "~Apply", ID_BTN_APPLY, 106, 1, 51, 14
-		PUSHBUTTON "Help", ID_BTN_HELP, 160, 1, 51, 14, BS_HELP
-		CONTROL "Sample", NB_CONSOLE_NOTEBOOK, 2, 17, 261, 147, WC_NOTEBOOK, BKS_SOLIDBIND | BKS_BACKPAGESBR | BKS_MAJORTABRIGHT | BKS_SQUARETABS | BKS_STATUSTEXTLEFT | BKS_TABTEXTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 0x0800
+		PUSHBUTTON    "~Undo",  ID_BTN_UNDO,  25, 1, 51, 14
+		DEFPUSHBUTTON "~Apply", ID_BTN_APPLY, 79, 1, 51, 14
+		PUSHBUTTON    "~Save",  ID_BTN_SAVE, 133, 1, 51, 14
+		PUSHBUTTON    "~Help",  ID_BTN_HELP, 187, 1, 51, 14, BS_HELP
+		CONTROL       "Sample", NB_CONSOLE_NOTEBOOK, 2, 17, 261, 147, WC_NOTEBOOK, BKS_SOLIDBIND | BKS_BACKPAGESBR | BKS_MAJORTABRIGHT | BKS_SQUARETABS | BKS_STATUSTEXTLEFT | BKS_TABTEXTLEFT | WS_VISIBLE | WS_GROUP | WS_TABSTOP | 0x0800
 		PRESPARAMS PP_FONTNAMESIZE "9.WarpSans"
 	END
@@ -78,6 +66,6 @@
 		CONTROL "Speaker duration", SLB_CONSOLE_SPEAKERDURATION, 58, 34, 145, 24, WC_SLIDER, SLS_HORIZONTAL | SLS_CENTER | SLS_HOMELEFT | SLS_PRIMARYSCALE1 | SLS_SNAPTOINCREMENT | WS_VISIBLE | WS_GROUP | WS_TABSTOP
 		CTLDATA 12, 0, 20, 9, 10, 9
+		DEFPUSHBUTTON "~Test",  ID_BTN_SPEAKERTEST,  69, 16, 71, 14
 	END
-
 END
 
Index: trunk/src/kernel32/console2.h
===================================================================
--- trunk/src/kernel32/console2.h	(revision 15)
+++ trunk/src/kernel32/console2.h	(revision 16)
@@ -1,9 +1,2 @@
-/* $Id: console2.h,v 1.1 1999-05-24 20:19:45 ktk Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
 /*
  * Win32 Console Subsystem for OS/2
@@ -11,5 +4,5 @@
  * 1998/02/11 PH Patrick Haller (haller@zebra.fh-weingarten.de)
  *
- * @(#) HandleManager.Cpp       1.0.0   1998/02/11 PH start
+ * @(#) HandleManager.Cpp       1.0.0	1998/02/11 PH start
  */
 
@@ -21,7 +14,7 @@
  * Remark                                                                    *
  *****************************************************************************
-
+ 
  */
-
+ 
 
 /*****************************************************************************
@@ -60,12 +53,12 @@
   PSZ   *ppszLine;                  /* an array of line pointers             */
   ULONG ulScrollLineOffset;          /* offset to the 1st line in the buffer */
-
+  
                 /* the following structures reflect the Win32 API structures */
   CONSOLE_CURSOR_INFO        CursorInfo;
   COORD                      coordCursorPosition;
-
+  
                                      /* the mode the console is currently in */
   DWORD                      dwConsoleMode;
-
+  
                               /* information about the current screen buffer */
   //  CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
@@ -86,18 +79,18 @@
 #endif
 
-
-DWORD ConsoleInit(void);       /* creation of the console subsystem */
-
-DWORD ConsoleDevicesRegister(void);       /* create console devices */
-
-void  ConsoleWaitClose(void);      /* wait for user to close console */
-
-BOOL  ConsoleIsActive(void);  /* returns TRUE if console window open */
-
-#ifndef _OS2WIN_H
-
-BOOL   WIN32API AllocConsole                  (VOID);
-
-HANDLE WIN32API CreateConsoleScreenBuffer     (DWORD         dwDesiredAccess,
+  
+DWORD EXPENTRY ConsoleInit(void);       /* creation of the console subsystem */
+  
+DWORD EXPENTRY ConsoleDevicesRegister(void);       /* create console devices */
+  
+void EXPENTRY ConsoleWaitClose(void);      /* wait for user to close console */
+
+BOOL EXPENTRY ConsoleIsActive(void);  /* returns TRUE if console window open */
+
+
+
+BOOL   WIN32API OS2AllocConsole                  (VOID);
+
+HANDLE WIN32API OS2CreateConsoleScreenBuffer     (DWORD         dwDesiredAccess,
                                                   DWORD         dwShareMode,
                                                   LPVOID        lpSecurityAttributes,
@@ -105,5 +98,5 @@
                                                   LPVOID        lpScreenBufferData);
 
-BOOL   WIN32API FillConsoleOutputAttribute    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2FillConsoleOutputAttribute    (HANDLE        hConsoleOutput,
                                                   WORD          wAttribute,
                                                   DWORD         nLength,
@@ -111,5 +104,5 @@
                                                   LPDWORD       lpNumberOfAttrsWritten);
 
-BOOL   WIN32API FillConsoleOutputCharacterW   (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2FillConsoleOutputCharacterW   (HANDLE        hConsoleOutput,
                                                   WCHAR         cCharacter,
                                                   DWORD         nLength,
@@ -117,5 +110,5 @@
                                                   LPDWORD       lpNumberOfCharsWritten);
 
-BOOL   WIN32API FillConsoleOutputCharacterA   (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2FillConsoleOutputCharacterA   (HANDLE        hConsoleOutput,
                                                   UCHAR         cCharacter,
                                                   DWORD         nLength,
@@ -124,48 +117,48 @@
 
 
-BOOL   WIN32API FlushConsoleInputBuffer       (HANDLE        hConsoleInput);
-
-BOOL   WIN32API FreeConsole                   (VOID);
-
-BOOL   WIN32API GenerateConsoleCtrlEvent      (DWORD         dwCtrlEvent,
+BOOL   WIN32API OS2FlushConsoleInputBuffer       (HANDLE        hConsoleInput);
+
+BOOL   WIN32API OS2FreeConsole                   (VOID);
+
+BOOL   WIN32API OS2GenerateConsoleCtrlEvent      (DWORD         dwCtrlEvent,
                                                   DWORD         dwProcessGroupId);
 
-UINT   WIN32API GetConsoleCP                  (VOID);
-
-BOOL   WIN32API GetConsoleCursorInfo          (HANDLE               hConsoleOutput,
+UINT   WIN32API OS2GetConsoleCP                  (VOID);
+
+BOOL   WIN32API OS2GetConsoleCursorInfo          (HANDLE               hConsoleOutput,
                                                   PCONSOLE_CURSOR_INFO lpConsoleCursorInfo);
 
-BOOL   WIN32API GetConsoleMode                (HANDLE        hConsole,
+BOOL   WIN32API OS2GetConsoleMode                (HANDLE        hConsole,
                                                   LPDWORD       lpMode);
 
-UINT   WIN32API GetConsoleOutputCP            (VOID);
-
-BOOL   WIN32API GetConsoleScreenBufferInfo    (HANDLE                      hConsoleOutput,
+UINT   WIN32API OS2GetConsoleOutputCP            (VOID);
+
+BOOL   WIN32API OS2GetConsoleScreenBufferInfo    (HANDLE                      hConsoleOutput,
                                                   PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo);
 
-DWORD  WIN32API GetConsoleTitleA              (LPTSTR        lpConsoleTitle,
+DWORD  WIN32API OS2GetConsoleTitleA              (LPTSTR        lpConsoleTitle,
                                                   DWORD         nSize);
 
-DWORD  WIN32API GetConsoleTitleW              (LPTSTR        lpConsoleTitle,
+DWORD  WIN32API OS2GetConsoleTitleW              (LPTSTR        lpConsoleTitle,
                                                   DWORD         nSize);
 
-COORD  WIN32API GetLargestConsoleWindowSize   (HANDLE        hConsoleOutput);
-
-BOOL   WIN32API GetNumberOfConsoleInputEvents (HANDLE        hConsoleInput,
+COORD  WIN32API OS2GetLargestConsoleWindowSize   (HANDLE        hConsoleOutput);
+
+BOOL   WIN32API OS2GetNumberOfConsoleInputEvents (HANDLE        hConsoleInput,
                                                   LPDWORD       lpNumberOfEvents);
 
-BOOL   WIN32API GetNumberOfConsoleMouseButtons(LPDWORD       lpcNumberOfMouseButtons);
-
-BOOL   WIN32API PeekConsoleInputA             (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2GetNumberOfConsoleMouseButtons(LPDWORD       lpcNumberOfMouseButtons);
+
+BOOL   WIN32API OS2PeekConsoleInputA             (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcRead);
 
-BOOL   WIN32API PeekConsoleInputW             (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2PeekConsoleInputW             (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcRead);
 
-BOOL   WIN32API ReadConsoleA                  (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2ReadConsoleA                  (HANDLE        hConsoleInput,
                                                   LPVOID        lpvBuffer,
                                                   DWORD         cchToRead,
@@ -173,15 +166,15 @@
                                                   LPVOID        lpvReserved);
 
-BOOL   WIN32API ReadConsoleInputA             (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2ReadConsoleInputA             (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcRead);
 
-BOOL   WIN32API ReadConsoleInputW             (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2ReadConsoleInputW             (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcRead);
 
-BOOL   WIN32API ReadConsoleOutputA            (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ReadConsoleOutputA            (HANDLE        hConsoleOutput,
                                                   PCHAR_INFO    pchiDestBuffer,
                                                   COORD         coordDestBufferSize,
@@ -189,5 +182,5 @@
                                                   PSMALL_RECT   psrctSourceRect);
 
-BOOL   WIN32API ReadConsoleOutputW            (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ReadConsoleOutputW            (HANDLE        hConsoleOutput,
                                                   PCHAR_INFO    pchiDestBuffer,
                                                   COORD         coordDestBufferSize,
@@ -195,5 +188,5 @@
                                                   PSMALL_RECT   psrctSourceRect);
 
-BOOL   WIN32API ReadConsoleOutputAttribute    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ReadConsoleOutputAttribute    (HANDLE        hConsoleOutput,
                                                   LPWORD        lpwAttribute,
                                                   DWORD         cReadCells,
@@ -201,5 +194,5 @@
                                                   LPDWORD       lpcNumberRead);
 
-BOOL   WIN32API ReadConsoleOutputCharacter    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ReadConsoleOutputCharacter    (HANDLE        hConsoleOutput,
                                                   LPTSTR        lpReadBuffer,
                                                   DWORD         cchRead,
@@ -207,5 +200,5 @@
                                                   LPDWORD       lpcNumberRead);
 
-BOOL   WIN32API ScrollConsoleScreenBufferA    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ScrollConsoleScreenBufferA    (HANDLE        hConsoleOutput,
                                                   PSMALL_RECT   psrctSourceRect,
                                                   PSMALL_RECT   psrctClipRect,
@@ -213,5 +206,5 @@
                                                   PCHAR_INFO    pchiFill);
 
-BOOL   WIN32API ScrollConsoleScreenBufferW    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2ScrollConsoleScreenBufferW    (HANDLE        hConsoleOutput,
                                                   PSMALL_RECT   psrctSourceRect,
                                                   PSMALL_RECT   psrctClipRect,
@@ -219,37 +212,37 @@
                                                   PCHAR_INFO    pchiFill);
 
-BOOL   WIN32API SetConsoleActiveScreenBuffer  (HANDLE        hConsoleOutput);
-
-BOOL   WIN32API SetConsoleCP                  (UINT          IDCodePage);
-
-BOOL   WIN32API SetConsoleCtrlHandler         (PHANDLER_ROUTINE pHandlerRoutine,
+BOOL   WIN32API OS2SetConsoleActiveScreenBuffer  (HANDLE        hConsoleOutput);
+
+BOOL   WIN32API OS2SetConsoleCP                  (UINT          IDCodePage);
+
+BOOL   WIN32API OS2SetConsoleCtrlHandler         (PHANDLER_ROUTINE pHandlerRoutine,
                                                   BOOL             fAdd);
 
-BOOL   WIN32API SetConsoleCursorInfo          (HANDLE               hConsoleOutput,
+BOOL   WIN32API OS2SetConsoleCursorInfo          (HANDLE               hConsoleOutput,
                                                   PCONSOLE_CURSOR_INFO lpConsoleCursorInfo);
 
-BOOL   WIN32API SetConsoleCursorPosition      (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2SetConsoleCursorPosition      (HANDLE        hConsoleOutput,
                                                   COORD         coordCursor);
 
-BOOL   WIN32API SetConsoleMode                (HANDLE        hConsole,
+BOOL   WIN32API OS2SetConsoleMode                (HANDLE        hConsole,
                                                   DWORD         fdwMode);
 
-BOOL   WIN32API SetConsoleOutputCP            (UINT          IDCodePage);
-
-BOOL   WIN32API SetConsoleScreenBufferSize    (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2SetConsoleOutputCP            (UINT          IDCodePage);
+
+BOOL   WIN32API OS2SetConsoleScreenBufferSize    (HANDLE        hConsoleOutput,
                                                   COORD         coordSize);
 
-BOOL   WIN32API SetConsoleTextAttribute       (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2SetConsoleTextAttribute       (HANDLE        hConsoleOutput,
                                                   WORD          wAttr);
 
-BOOL   WIN32API SetConsoleTitleA              (LPTSTR        lpszTitle);
-
-BOOL   WIN32API SetConsoleTitleW              (LPTSTR        lpszTitle);
-
-BOOL   WIN32API SetConsoleWindowInfo          (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2SetConsoleTitleA              (LPTSTR        lpszTitle);
+
+BOOL   WIN32API OS2SetConsoleTitleW              (LPTSTR        lpszTitle);
+
+BOOL   WIN32API OS2SetConsoleWindowInfo          (HANDLE        hConsoleOutput,
                                                   BOOL          fAbsolute,
                                                   PSMALL_RECT   psrctWindowRect);
 
-BOOL   WIN32API WriteConsoleA                 (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleA                 (HANDLE        hConsoleOutput,
                                                   CONST VOID*   lpvBuffer,
                                                   DWORD         cchToWrite,
@@ -257,15 +250,15 @@
                                                   LPVOID        lpvReserved);
 
-BOOL   WIN32API WriteConsoleInputA            (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2WriteConsoleInputA            (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcWritten);
 
-BOOL   WIN32API WriteConsoleInputW            (HANDLE        hConsoleInput,
+BOOL   WIN32API OS2WriteConsoleInputW            (HANDLE        hConsoleInput,
                                                   PINPUT_RECORD pirBuffer,
                                                   DWORD         cInRecords,
                                                   LPDWORD       lpcWritten);
 
-BOOL   WIN32API WriteConsoleOutputA           (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleOutputA           (HANDLE        hConsoleOutput,
                                                   PCHAR_INFO    pchiSrcBuffer,
                                                   COORD         coordSrcBufferSize,
@@ -273,5 +266,5 @@
                                                   PSMALL_RECT   psrctDestRect);
 
-BOOL   WIN32API WriteConsoleOutputW           (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleOutputW           (HANDLE        hConsoleOutput,
                                                   PCHAR_INFO    pchiSrcBuffer,
                                                   COORD         coordSrcBufferSize,
@@ -279,5 +272,5 @@
                                                   PSMALL_RECT   psrctDestRect);
 
-BOOL   WIN32API WriteConsoleOutputAttribute   (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleOutputAttribute   (HANDLE        hConsoleOutput,
                                                   LPWORD        lpwAttribute,
                                                   DWORD         cWriteCells,
@@ -285,5 +278,5 @@
                                                   LPDWORD       lpcNumberWritten);
 
-BOOL   WIN32API WriteConsoleOutputCharacterA  (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleOutputCharacterA  (HANDLE        hConsoleOutput,
                                                   LPTSTR        lpWriteBuffer,
                                                   DWORD         cchWrite,
@@ -291,5 +284,5 @@
                                                   LPDWORD       lpcWritten);
 
-BOOL   WIN32API WriteConsoleOutputCharacterW  (HANDLE        hConsoleOutput,
+BOOL   WIN32API OS2WriteConsoleOutputCharacterW  (HANDLE        hConsoleOutput,
                                                   LPTSTR        lpWriteBuffer,
                                                   DWORD         cchWrite,
@@ -297,8 +290,7 @@
                                                   LPDWORD       lpcWritten);
 
-
-#endif // _OS2WIN_H
-
-
+  
+  
+  
 #ifdef __cplusplus
 }
@@ -326,9 +318,9 @@
     /* input queue */
     DWORD dwNumberOfInputEvents;   /* number of unread events in input queue */
-
+  
   public:
     HMDeviceConsoleInClass(LPCSTR lpDeviceName)
       : HMDeviceHandler(lpDeviceName) {}
-
+  
                        /* this is a handler method for calls to CreateFile() */
   virtual DWORD  CreateFile (LPCSTR        lpFileName,
@@ -336,5 +328,5 @@
                              PVOID         lpSecurityAttributes,
                              PHMHANDLEDATA pHMHandleDataTemplate);
-
+  
                            /* this is a handler method for calls to ReadFile() */
   virtual DWORD  ReadFile   (PHMHANDLEDATA pHMHandleData,
@@ -361,10 +353,10 @@
    * non-standard console I/O methods *
    ************************************/
-
+  
   virtual BOOL  FlushConsoleInputBuffer(PHMHANDLEDATA pHMHandleData);
-
+  
   virtual DWORD GetConsoleMode(PHMHANDLEDATA pHMHandleData,
                                LPDWORD       lpMode);
-
+  
   virtual BOOL  GetNumberOfConsoleInputEvents(PHMHANDLEDATA pHMHandleData,
                                               LPDWORD       lpNumberOfEvents);
@@ -374,16 +366,16 @@
                                   DWORD         cInRecords,
                                   LPDWORD       lpcRead);
-
+  
   virtual DWORD PeekConsoleInputW(PHMHANDLEDATA pHMHandleData,
                                   PINPUT_RECORD pirBuffer,
                                   DWORD         cInRecords,
                                   LPDWORD       lpcRead);
-
+  
   virtual DWORD ReadConsoleA(PHMHANDLEDATA pHMHandleData,
                              CONST VOID*   lpvBuffer,
                              DWORD         cchToRead,
                              LPDWORD       lpcchRead,
-                             LPVOID        lpvReserved);
-
+                             LPVOID        lpvReserved);  
+  
   virtual DWORD ReadConsoleW(PHMHANDLEDATA pHMHandleData,
                              CONST VOID*   lpvBuffer,
@@ -391,28 +383,28 @@
                              LPDWORD       lpcchRead,
                              LPVOID        lpvReserved);
-
+  
   virtual DWORD ReadConsoleInputA(PHMHANDLEDATA pHMHandleData,
                                   PINPUT_RECORD pirBuffer,
                                   DWORD         cInRecords,
                                   LPDWORD       lpcRead);
-
+  
   virtual DWORD ReadConsoleInputW(PHMHANDLEDATA pHMHandleData,
                                   PINPUT_RECORD pirBuffer,
                                   DWORD         cInRecords,
                                   LPDWORD       lpcRead);
-
+  
   virtual DWORD SetConsoleMode(PHMHANDLEDATA pHMHandleData,
                                DWORD         dwMode);
-
+  
   virtual DWORD WriteConsoleInputA (PHMHANDLEDATA pHMHandleData,
                                     PINPUT_RECORD pirBuffer,
                                     DWORD         cInRecords,
-                                    LPDWORD       lpcWritten);
-
+                                    LPDWORD       lpcWritten);  
+  
   virtual DWORD WriteConsoleInputW (PHMHANDLEDATA pHMHandleData,
                                     PINPUT_RECORD pirBuffer,
                                     DWORD         cInRecords,
                                     LPDWORD       lpcWritten);
-
+  
 };
 
@@ -426,9 +418,9 @@
   protected:
     HANDLE hConsoleBuffer;            /* handle to the active console buffer */
-
+  
   public:
     HMDeviceConsoleOutClass(LPCSTR lpDeviceName)
       : HMDeviceHandler(lpDeviceName) {}
-
+  
                        /* this is a handler method for calls to CreateFile() */
   virtual DWORD  CreateFile (LPCSTR        lpFileName,
@@ -436,5 +428,5 @@
                              PVOID         lpSecurityAttributes,
                              PHMHANDLEDATA pHMHandleDataTemplate);
-
+  
                            /* this is a handler method for calls to ReadFile() */
   virtual DWORD  ReadFile   (PHMHANDLEDATA pHMHandleData,
@@ -450,6 +442,6 @@
                              LPDWORD       lpNumberOfBytesWritten,
                              LPOVERLAPPED  lpOverlapped);
-
-
+  
+  
                                                 /* handling non-standard I/O */
   virtual DWORD _DeviceRequest (PHMHANDLEDATA pHMHandleData,
@@ -472,5 +464,5 @@
     HMDeviceConsoleBufferClass(LPCSTR lpDeviceName)
       : HMDeviceHandler(lpDeviceName) {}
-
+  
                        /* this is a handler method for calls to CreateFile() */
   virtual DWORD  CreateFile (LPCSTR        lpFileName,
@@ -478,5 +470,5 @@
                              PVOID         lpSecurityAttributes,
                              PHMHANDLEDATA pHMHandleDataTemplate);
-
+  
                            /* this is a handler method for calls to ReadFile() */
   virtual DWORD  ReadFile   (PHMHANDLEDATA pHMHandleData,
@@ -492,7 +484,7 @@
                              LPDWORD       lpNumberOfBytesWritten,
                              LPOVERLAPPED  lpOverlapped);
-
+  
   virtual DWORD  CloseHandle(PHMHANDLEDATA pHMHandleData);
-
+  
   virtual DWORD  _DeviceRequest (PHMHANDLEDATA pHMHandleData,
                                  ULONG         ulRequestCode,
@@ -501,10 +493,10 @@
                                  ULONG         arg3,
                                  ULONG         arg4);
-
-
+  
+  
   /************************************
    * non-standard console I/O methods *
    ************************************/
-
+  
   virtual DWORD  FillConsoleOutputAttribute(PHMHANDLEDATA pHMHandleData,
                                             WORD          wAttribute,
@@ -512,5 +504,5 @@
                                             COORD         dwWriteCoord,
                                             LPDWORD       lpNumberOfAttrsWritten);
-
+  
   virtual DWORD  FillConsoleOutputCharacterA(PHMHANDLEDATA pHMHandleData,
                                              UCHAR         ucCharacter,
@@ -518,28 +510,28 @@
                                              COORD         dwWriteCoord,
                                              LPDWORD       lpNumberOfCharsWritten);
-
+  
   virtual DWORD  FillConsoleOutputCharacterW(PHMHANDLEDATA pHMHandleData,
                                              WCHAR         wcCharacter,
                                              DWORD         nLength,
                                              COORD         dwWriteCoord,
-                                             LPDWORD       lpNumberOfCharsWritten);
-
+                                             LPDWORD       lpNumberOfCharsWritten);  
+  
   virtual DWORD  GetConsoleCursorInfo(PHMHANDLEDATA        pHMHandleData,
                                       PCONSOLE_CURSOR_INFO pCCI);
-
+  
   virtual DWORD  GetConsoleMode(PHMHANDLEDATA pHMHandleData,
                                 LPDWORD       lpMode);
-
+  
   virtual DWORD  GetLargestConsoleWindowSize(PHMHANDLEDATA pHMHandleData);
-
+  
   virtual DWORD  GetConsoleScreenBufferInfo(PHMHANDLEDATA               pHMHandleData,
                                             PCONSOLE_SCREEN_BUFFER_INFO pCSBI);
-
+  
   virtual DWORD  ReadConsoleOutputA(PHMHANDLEDATA pHMHandleData,
                                     PCHAR_INFO    pchiDestBuffer,
                                     COORD         coordDestBufferSize,
                                     COORD         coordDestBufferCoord,
-                                    PSMALL_RECT   psrctSourceRect);
-
+                                    PSMALL_RECT   psrctSourceRect);  
+  
   virtual DWORD  ReadConsoleOutputW(PHMHANDLEDATA pHMHandleData,
                                     PCHAR_INFO    pchiDestBuffer,
@@ -565,5 +557,5 @@
                                              COORD         coordReadCoord,
                                              LPDWORD       lpcNumberRead);
-
+  
   virtual DWORD  ScrollConsoleScreenBufferA(PHMHANDLEDATA pHMHandleData,
                                             PSMALL_RECT   psrctSourceRect,
@@ -571,5 +563,5 @@
                                             COORD         coordDestOrigin,
                                             PCHAR_INFO    pchiFill);
-
+  
   virtual DWORD  ScrollConsoleScreenBufferW(PHMHANDLEDATA pHMHandleData,
                                             PSMALL_RECT   psrctSourceRect,
@@ -580,29 +572,29 @@
   virtual DWORD  SetConsoleScreenBufferSize (PHMHANDLEDATA pHMHandleData,
                                              COORD         coordSize);
-
+  
   virtual DWORD  SetConsoleCursorInfo(PHMHANDLEDATA        pHMHandleData,
                                       PCONSOLE_CURSOR_INFO pCCI);
-
+  
   virtual DWORD  SetConsoleCursorPosition(PHMHANDLEDATA pHMHandleData,
                                           COORD         coordCursorPosition);
-
+  
   virtual DWORD  SetConsoleMode(PHMHANDLEDATA pHMHandleData,
                                 DWORD         dwMode);
-
+  
   virtual DWORD  SetConsoleTextAttribute    (PHMHANDLEDATA pHMHandleData,
                                              WORD          wAttr);
-
+  
   virtual DWORD  SetConsoleActiveScreenBuffer(PHMHANDLEDATA pHMHandleData);
-
+  
   virtual BOOL   SetConsoleWindowInfo(PHMHANDLEDATA pHMHandleData,
                                       BOOL          fAbsolute,
                                       PSMALL_RECT   psrctWindowRect);
-
+  
   virtual DWORD  WriteConsoleA(PHMHANDLEDATA pHMHandleData,
                                CONST VOID*   lpvBuffer,
                                DWORD         cchToWrite,
                                LPDWORD       lpcchWritten,
-                               LPVOID        lpvReserved);
-
+                               LPVOID        lpvReserved);  
+  
   virtual DWORD  WriteConsoleW(PHMHANDLEDATA pHMHandleData,
                                CONST VOID*   lpvBuffer,
@@ -610,11 +602,11 @@
                                LPDWORD       lpcchWritten,
                                LPVOID        lpvReserved);
-
+  
   virtual DWORD  WriteConsoleOutputA(PHMHANDLEDATA pHMHandleData,
                                      PCHAR_INFO    pchiSrcBuffer,
                                      COORD         coordSrcBufferSize,
                                      COORD         coordSrcBufferCoord,
-                                     PSMALL_RECT   psrctDestRect);
-
+                                     PSMALL_RECT   psrctDestRect);  
+  
   virtual DWORD  WriteConsoleOutputW(PHMHANDLEDATA pHMHandleData,
                                      PCHAR_INFO    pchiSrcBuffer,
@@ -622,5 +614,5 @@
                                      COORD         coordSrcBufferCoord,
                                      PSMALL_RECT   psrctDestRect);
-
+  
   virtual DWORD  WriteConsoleOutputAttribute(PHMHANDLEDATA pHMHandleData,
                                              LPWORD        lpwAttribute,
@@ -628,5 +620,5 @@
                                              COORD         dwWriteCoord,
                                              LPDWORD       lpcWritten);
-
+  
   virtual DWORD  WriteConsoleOutputCharacterA(PHMHANDLEDATA pHMHandleData,
                                               LPTSTR        lpWriteBuffer,
@@ -634,10 +626,10 @@
                                               COORD         dwWriteCoord,
                                               LPDWORD       lpcWritten);
-
+  
   virtual DWORD  WriteConsoleOutputCharacterW(PHMHANDLEDATA pHMHandleData,
                                               LPWSTR        lpWriteBuffer,
                                               DWORD         cchWrite,
                                               COORD         dwWriteCoord,
-                                              LPDWORD       lpcWritten);
+                                              LPDWORD       lpcWritten);  
 };
 
