Click here to Skip to main content
15,895,084 members
Articles / Desktop Programming / MFC

Office 2000 Style Html Help Viewer

Rate me:
Please Sign up or sign in to vote.
4.45/5 (10 votes)
19 Feb 2001 139.5K   2K   45  
A free (source included) Html Help Viewer, in the style of the Office 2000 Help Viewer, including docking and auto-hide.
/*
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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
CEO Bttlxe Ltd & Incentica Ltd
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions