minor changes

svn path=/trunk/; revision=1822
This commit is contained in:
Nedko Arnaudov 2001-04-24 22:53:00 +00:00
parent 5ac5ed1e37
commit 05a5575ff1
4 changed files with 64 additions and 65 deletions

View file

@ -1,4 +1,4 @@
/* $Id: RegistryExplorer.cpp,v 1.6 2001/04/16 05:11:54 narnaoud Exp $ /* $Id: RegistryExplorer.cpp,v 1.7 2001/04/24 22:53:00 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
@ -85,6 +85,13 @@ BOOL WINAPI HandlerRoutine(DWORD dwCtrlType)
//int _tmain(/*int argc, TCHAR* argv[], TCHAR* envp[]*/) //int _tmain(/*int argc, TCHAR* argv[], TCHAR* envp[]*/)
int main () int main ()
{ {
int nRetCode = 0;
HRESULT hr;
CSettings *pSettings = NULL;
CPrompt *pPrompt = NULL;
CShellCommandsLinkedList CommandsList(Console); CShellCommandsLinkedList CommandsList(Console);
CShellCommandExit ExitCommand; CShellCommandExit ExitCommand;
@ -114,9 +121,6 @@ int main ()
CShellCommandSACL SACLCommand(Tree); CShellCommandSACL SACLCommand(Tree);
CommandsList.AddCommand(&SACLCommand); CommandsList.AddCommand(&SACLCommand);
//CShellCommandDOKA DOKACommand(Tree);
//CommandsList.AddCommand(&DOKACommand);
CShellCommandConnect ConnectCommand(Tree); CShellCommandConnect ConnectCommand(Tree);
CommandsList.AddCommand(&ConnectCommand); CommandsList.AddCommand(&ConnectCommand);
@ -134,13 +138,6 @@ int main ()
CArgumentParser Parser; CArgumentParser Parser;
int nRetCode = 0;
HRESULT hr;
CSettings *pSettings = NULL;
CPrompt *pPrompt = NULL;
pSettings = new CSettings(); pSettings = new CSettings();
if (!pSettings) if (!pSettings)
{ {
@ -215,7 +212,7 @@ GetCommand:
blnCommandExecutionInProgress = FALSE; blnCommandExecutionInProgress = FALSE;
// Set command line color // Set command line color
Console.SetTextAttribute(pSettings->GetPromptTextAttributes()); Console.SetTextAttribute(pSettings->GetCommandTextAttributes());
if (!Console.ReadLine()) if (!Console.ReadLine())
goto Abort; goto Abort;

View file

@ -1,4 +1,4 @@
/* $Id: RegistryExplorer.h,v 1.6 2001/04/16 05:11:54 narnaoud Exp $ */ /* $Id: RegistryExplorer.h,v 1.7 2001/04/24 22:53:00 narnaoud Exp $ */
#ifndef _REGISTRY_EXPLORER_H__INCLUDED #ifndef _REGISTRY_EXPLORER_H__INCLUDED
#define _REGISTRY_EXPLORER_H__INCLUDED #define _REGISTRY_EXPLORER_H__INCLUDED
@ -49,9 +49,11 @@
#define COMMAND_NA_ON_ROOT _T(" is not applicable to root key.\n") #define COMMAND_NA_ON_ROOT _T(" is not applicable to root key.\n")
#define SETTINGS_REGISTRY_KEY _T("SOFTWARE\\Registry Explorer") #define SETTINGS_REGISTRY_KEY _T("Software\\Registry Explorer\\")
#define NORMAL_TEXT_ATTRIBUTES_VALUE_NAME _T("Normal Text Color") #define NORMAL_TEXT_ATTRIBUTES_VALUE_NAME _T("Normal Text Color")
#define PROMPT_TEXT_ATTRIBUTES_VALUE_NAME _T("Prompt Text Color") #define COMMAND_TEXT_ATTRIBUTES_VALUE_NAME _T("Command Text Color")
#define PROMPT_VALUE_NAME _T("Prompt") #define PROMPT_VALUE_NAME _T("Prompt")
#define DEFAULT_ESCAPE_CHAR _T('^')
#endif //#ifndef _REGISTRY_EXPLORER_H__INCLUDED #endif //#ifndef _REGISTRY_EXPLORER_H__INCLUDED

View file

@ -1,4 +1,4 @@
/* $Id: Settings.cpp,v 1.1 2001/04/16 05:03:29 narnaoud Exp $ /* $Id: Settings.cpp,v 1.2 2001/04/24 22:53:00 narnaoud Exp $
* *
* regexpl - Console Registry Explorer * regexpl - Console Registry Explorer
* *
@ -28,14 +28,14 @@
#include "Prompt.h" #include "Prompt.h"
#define DEFAULT_NORMAL_TEXT_ATTRIBUTES FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED #define DEFAULT_NORMAL_TEXT_ATTRIBUTES FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED
#define DEFAULT_PROMPT_TEXT_ATTRIBUTES FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED #define DEFAULT_COMMAND_TEXT_ATTRIBUTES FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED
CSettings::CSettings() CSettings::CSettings()
{ {
m_pszPrompt = NULL; m_pszPrompt = NULL;
m_wNormalTextAttributes = DEFAULT_NORMAL_TEXT_ATTRIBUTES; m_wNormalTextAttributes = DEFAULT_NORMAL_TEXT_ATTRIBUTES;
m_wPromptTextAttributes = DEFAULT_PROMPT_TEXT_ATTRIBUTES; m_wCommandTextAttributes = DEFAULT_COMMAND_TEXT_ATTRIBUTES;
} }
CSettings::~CSettings() CSettings::~CSettings()
@ -107,14 +107,14 @@ HRESULT CSettings::Load(LPCTSTR pszLoadKey)
} }
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
nError = RegQueryValueEx(hKey,PROMPT_TEXT_ATTRIBUTES_VALUE_NAME,NULL,&dwType,(BYTE *)&w,&dwSize); nError = RegQueryValueEx(hKey,COMMAND_TEXT_ATTRIBUTES_VALUE_NAME,NULL,&dwType,(BYTE *)&w,&dwSize);
if (nError != ERROR_SUCCESS || dwType != REG_DWORD) if (nError != ERROR_SUCCESS || dwType != REG_DWORD)
{ {
hr = S_FALSE; hr = S_FALSE;
} }
else else
{ {
m_wPromptTextAttributes = (WORD)w; m_wCommandTextAttributes = (WORD)w;
} }
Exit: Exit:
@ -140,7 +140,7 @@ WORD CSettings::GetNormalTextAttributes()
return m_wNormalTextAttributes; return m_wNormalTextAttributes;
} }
WORD CSettings::GetPromptTextAttributes() WORD CSettings::GetCommandTextAttributes()
{ {
return m_wPromptTextAttributes; return m_wCommandTextAttributes;
} }

View file

@ -1,4 +1,4 @@
/* $Id: Settings.h,v 1.1 2001/04/16 05:03:29 narnaoud Exp $ */ /* $Id: Settings.h,v 1.2 2001/04/24 22:53:00 narnaoud Exp $ */
#ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED #ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
#define OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED #define OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
@ -12,12 +12,12 @@ public:
HRESULT Store(LPCTSTR pszStoreKey); HRESULT Store(LPCTSTR pszStoreKey);
LPCTSTR GetPrompt(); LPCTSTR GetPrompt();
WORD GetNormalTextAttributes(); WORD GetNormalTextAttributes();
WORD GetPromptTextAttributes(); WORD GetCommandTextAttributes();
private: private:
HRESULT Clean(); HRESULT Clean();
LPTSTR m_pszPrompt; LPTSTR m_pszPrompt;
WORD m_wNormalTextAttributes; WORD m_wNormalTextAttributes;
WORD m_wPromptTextAttributes; WORD m_wCommandTextAttributes;
}; };
#endif // #ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED #endif // #ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED