/* $Id: conprop2.cpp,v 1.7 2001年03月13日 18:45:33 sandervl Exp $ */ /* * Win32 Console API Translation for OS/2 * * 1998年03月06日 Patrick Haller (haller@zebra.fh-weingarten.de) * * @(#) conprop.cpp 1.0.0 1998年03月06日 PH Start from scratch */ /***************************************************************************** * Remark * ***************************************************************************** - save / load properties from EAs */ /***************************************************************************** * Includes * *****************************************************************************/ #include #include #include #define INCL_GPI #define INCL_WIN #define INCL_DOSMEMMGR #define INCL_DOSSEMAPHORES #define INCL_DOSERRORS #define INCL_DOSPROCESS #define INCL_DOSMODULEMGR #define INCL_VIO #define INCL_AVIO #include //Odin32 OS/2 api wrappers #include #include #include #include #include "console.h" #include "console2.h" #include "conprop.h" #define DBG_LOCALLOG DBG_conprop2 #include "dbglocal.h" ODINDEBUGCHANNEL(KERNEL32-CONPROP2) /***************************************************************************** * Defines * *****************************************************************************/ /***************************************************************************** * Name : iQueryModuleKeyName * Funktion : determine name of key to store the console properties for * this process * Parameter : * Variablen : * Ergebnis : * Bemerkung : * * Autor : Patrick Haller [1998年06月13日 23:20] *****************************************************************************/ static DWORD iQueryModuleKeyName(LPSTR lpstrProcessName, DWORD dwProcessNameLength) { // Note: one might want to scan the string and replace illegal characters // or use a module name only instead of the fully qualified path! return(GetModuleFileNameA(NULL, lpstrProcessName, dwProcessNameLength)); } /***************************************************************************** * Name : APIRET EXPENTRY ConsolePropertyDefault * Funktion : load default options * Parameter : PICONSOLEOPTIONS pConsoleOptions * Variablen : * Ergebnis : APIRET * Bemerkung : * * Autor : Patrick Haller [1998年06月13日 23:20] *****************************************************************************/ DWORD ConsolePropertyDefault(PICONSOLEOPTIONS pConsoleOptions) { /************************************* * Initialize Console Window Options * *************************************/ pConsoleOptions->fTerminateAutomatically = FALSE; pConsoleOptions->fSpeakerEnabled = TRUE; pConsoleOptions->fSetWindowPosition = FALSE; pConsoleOptions->coordDefaultPosition.X = 0; pConsoleOptions->coordDefaultPosition.Y = 0; pConsoleOptions->coordDefaultSize.X = 80; pConsoleOptions->coordDefaultSize.Y = 25; pConsoleOptions->fQuickInsert = FALSE; pConsoleOptions->fInsertMode = FALSE; pConsoleOptions->fMouseActions = FALSE; pConsoleOptions->fToolbarActive = FALSE; pConsoleOptions->ucDefaultAttribute = 0x0007; /* 07 = grey on black */ pConsoleOptions->ulTabSize = 8; /* tabulator size */ pConsoleOptions->ulUpdateLimit = 8; /* scroll max. n lines */ /* priority settings for message thread */ pConsoleOptions->ulConsoleThreadPriorityClass = PRTYC_REGULAR; pConsoleOptions->ulConsoleThreadPriorityDelta = +10; pConsoleOptions->ucCursorDivisor = 10; /* timer divisor for blinking */ return NO_ERROR; } /***************************************************************************** * Name : APIRET EXPENTRY ConsolePropertyLoad * Funktion : load properties from registry * Parameter : PICONSOLEOPTIONS pConsoleOptions * Variablen : * Ergebnis : APIRET * Bemerkung : * * Autor : Patrick Haller [1998年06月13日 23:20] *****************************************************************************/ DWORD ConsolePropertyLoad(PICONSOLEOPTIONS pConsoleOptions) { dprintf (("KERNEL32: Console:ConsolePropertyLoad(%08xh)\n", pConsoleOptions)); // HKEY_CURRENT_USER/SOFTWARE/ODIN/ConsoleProperties//