Click here to Skip to main content
15,885,914 members
Articles / Desktop Programming / WTL

Font Enumerator

Rate me:
Please Sign up or sign in to vote.
5.00/5 (10 votes)
1 Sep 2009CPOL7 min read 36K   3.1K   26  
A tool that enumerates all fonts installed on Windows, and shows you the preview so as to help you code conveniently.
// This file was generated by WTL Dialog wizard 
// InputSampleString.cpp : Implementation of InputSampleString

#include "stdafx.h"
#include "InputSampleString.h"

// InputSampleString
InputSampleString::InputSampleString(std::tstring& strSample)
{
	m_strExample = strSample;
}

InputSampleString::~InputSampleString()
{
}

LRESULT InputSampleString::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	uMsg; wParam; lParam; bHandled;

	DoDataExchange();

	switch (_Lang)
	{
	case LANG_KOREAN:
		m_wndIdok.SetWindowText(STR_CONFIRM);
		m_wndIdcancel.SetWindowText(STR_CANCEL);
		this->SetWindowText(STR_INPUT_EXAMPLE);
		break;
	default:
		m_wndIdok.SetWindowText(STR_CONFIRM_ENG);
		m_wndIdcancel.SetWindowText(STR_CANCEL_ENG);
		this->SetWindowText(STR_INPUT_EXAMPLE_ENG);
		break;
	}
	m_wndSample.SetLimitText(LIMIT_TEXT);
	m_wndSample.SetWindowText(m_strExample.c_str());
	m_wndSample.SetFocus();

	WindowsHelper::setFont<true>(_Font, *this);

	return 1;  // Let the system set the focus
}

LRESULT InputSampleString::OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	wNotifyCode; wID; hWndCtl; bHandled;

	DoDataExchange(TRUE);
	TCHAR	temp[LIMIT_TEXT + 1];
	m_wndSample.GetWindowText(temp, LIMIT_TEXT + 1);
	m_strExample = temp;
	EndDialog(wID);
	return 0;
}

LRESULT InputSampleString::OnClickedCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
	wNotifyCode; wID; hWndCtl; bHandled;

	EndDialog(wID);
	return 0;
}

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
Korea (Republic of) Korea (Republic of)
I like programming.
I am teaching at AUCA (American University of Central Asia) now.

Comments and Discussions