Click here to Skip to main content
15,885,856 members
Articles / Desktop Programming / MFC

Transparent Console Application

Rate me:
Please Sign up or sign in to vote.
4.18/5 (9 votes)
30 Aug 2004CPOL2 min read 61.4K   2.1K   23  
Implementing a transparent console application.
// FontHelper.h: interface for the CFontHelper class.
// Created by Ahmad Yassin.
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FONTHELPER_H__71AC1D69_15EF_4F4F_B819_7F9746A1E217__INCLUDED_)
#define AFX_FONTHELPER_H__71AC1D69_15EF_4F4F_B819_7F9746A1E217__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CFontHelper : public CObject  
{
public:
	CFontHelper();
	CFontHelper(LPCTSTR szSection, LPCTSTR szEntry);
	virtual ~CFontHelper();

// public interface
public:
	// 1. data access 
	HFONT CreateFont();
	LOGFONT GetLogFont(LOGFONT& LogFont);
	HFONT GetFontHandle();

	// 2. save/restore
	void Save();
	void Restore();
	void SetSectionName(LPCTSTR szSection);
	void SetEntryName(LPCTSTR szEntry);

	// 3. Windows common font picker dialog
	BOOL ChooseFont();

// internal helpers
protected:
	// 4. default font 
	void DefaultFontInit();
	void DefaultInit();

// internal members
protected:
	HFONT m_hFont;
	LOGFONT m_LogFont;
	CString m_szSection;
	CString m_szEntry;

};

#endif // !defined(AFX_FONTHELPER_H__71AC1D69_15EF_4F4F_B819_7F9746A1E217__INCLUDED_)

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Israel Israel
Software designer and programmer.
Programming languages:
MFC, C++, Java , C#, VB and sometimes C and assembly.

Comments and Discussions