|
/*
Module : HKLM.H
Purpose: Interface for a class to provide simple
access to the HKEY_LOCAL_MACHINE\Software\Company\MyApp
registry key similiar to the functions MFC provides
to access the same settings in HKEY_CURRENT_USER
Created: PJN / 27-07-1998
History: None
Copyright (c) 1998 by PJ Naughter.
All rights reserved.
*/
#ifndef __HKLM_H__
#define __HKLM_H__
class CHKLM
{
public:
//Perform the same job as the function of the same name
// in the CWinApp class in MFC
void SetRegistryKey(LPCTSTR lpszRegistryKey);
void SetRegistryKey(UINT nIDRegistryKey);
//Allows saving and restoring of a profile settings to the
//HKEY_LOCAL_MACHINE\Software\"Company Name"\"Product Name"
//registry key. These classes are modelled upon the functions
//of the same name in the CWinApp class in MFC
BOOL WriteProfileString(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszValue);
BOOL WriteProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nValue);
CString GetProfileString(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszDefault = NULL);
UINT GetProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int nDefault);
BOOL GetProfileBinary(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPBYTE* ppData, UINT* pBytes);
BOOL WriteProfileBinary(LPCTSTR lpszSection, LPCTSTR lpszEntry, LPBYTE pData, UINT nBytes);
BOOL GetProfileStringArray(LPCTSTR lpszSection, LPCTSTR lpszEntry, CStringArray& array);
BOOL WriteProfileStringArray(LPCTSTR lpszSection, LPCTSTR lpszEntry, const CStringArray& array);
protected:
HKEY GetAppRegistryKey();
HKEY GetSectionKey(LPCTSTR lpszSection);
HKEY GetServiceRegistryKey();
BOOL GetStringArrayFromRegistry(HKEY hKey, const CString& sEntry, CStringArray& array);
BOOL SetStringArrayIntoRegistry(HKEY hKey, const CString& sEntry, const CStringArray& array);
CString m_sRegistryKey;
};
#endif //__HKLM_H__
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.