// MsgPanel.cpp : _xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDjHhAiCmMiDeHiDjDiDgHiDiK_xHqqkZx_ _xZkqqHx_iDhMiDeDiDjDiDgHiCmMjCoIiLgA_xHqqkZx_
//

#include "stdafx.h"
#include "resource.h"
#include "UtilGraph.h"	// For CalcStrWidth.

#define MAX_LOADSTRING	100
#define MAX_MSGSTRING	2000

// _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjE_xHqqkZx_:
HINSTANCE g_hInstance = NULL;						// _xZkqqHx_iMlLiNnNiCmMiDeDiDjDiDfIiDfOiDjDiDfI_xHqqkZx_
TCHAR g_szTitle[MAX_LOADSTRING] = {_T('\0')};		// _xZkqqHx_iDfOiDeDiDgHiDiL_xHqqkZx_ _xZkqqHx_iDgPiBfL_xHqqkZx_ _xZkqqHx_iDgFiDeMiDfIiDgH_xHqqkZx_
TCHAR g_szWindowClass[MAX_LOADSTRING] = {_T('\0')};	// _xZkqqHx_iDfOiDeDiDgHiDiL_xHqqkZx_ _xZkqqHx_iDgPiBfL_xHqqkZx_ _xZkqqHx_iDgFiDeMiDfIiDgH_xHqqkZx_
TCHAR g_szMessage[MAX_MSGSTRING] = {_T('\0')};
long g_lX = 200;
long g_lY = 200;
// 06.02.27 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
HWND g_hwndFrom = NULL;		// _xZkqqHx_iClBiCmMiDeBiDhGiDiKiMmEiCnBiPgPiClFiMlDiCmMiDiBiDeDiDjDiDeFiDeCiDjDiDgIiDeFiBeC_xHqqkZx_

// _xZkqqHx_iClBiCmMiDfCiBfLiDgI_xHqqkZx_ _xZkqqHx_iDiCiDfHiDiFiBfLiDiLiCmJiKnMiCnMiCoKiCoJiKnGjAjEiCmMjBePjAoJiMlO_xHqqkZx_:
static ATOM			MyRegisterClass (HINSTANCE hInstance);
static HWND			InitInstance (HINSTANCE, int);
LRESULT CALLBACK	WndProc (HWND, UINT, WPARAM, LPARAM);
// 01.06.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//LRESULT CALLBACK	About (HWND, UINT, WPARAM, LPARAM);
static void CalcWindowSize (SIZE& size, HWND hWnd, const TCHAR* tcpStr);
static const LOGFONT& GetLogFont ();

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	WinMain
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCmMiNmFiPiJiCmJiOmAiNhDiClDiCoKiCoJiKnGjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
int APIENTRY WinMain (	HINSTANCE hInstance,
						HINSTANCE hPrevInstance,
						LPSTR lpCmdLine,
						int nCmdShow)
{
//	DebugBreak();
	//----- _xZkqqHx_iJoGjGmKiCmMiDfEiDeDiDfJiCpAiOoGjDlO_xHqqkZx_ -----
	HDC hAttribDC = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
	if (hAttribDC != NULL)
	{
		int iDisplayW = GetDeviceCaps(hAttribDC, HORZRES);
		int iDisplayH = GetDeviceCaps(hAttribDC, VERTRES);
		::DeleteDC(hAttribDC);
		//----- _xZkqqHx_iJoGjGmKjCiGiJjLiCpAiBeBiDfPiDeDiDeBiDiNiDePjFfMiOkGiImKjChFiCmMiDgGiDhEiDeIiDiLiDgHiCmJ_xHqqkZx_ -----
		g_lX = iDisplayW / 2;
		g_lY = iDisplayH / 2;
	}

	int iMillisec = 2000;	// _xZkqqHx_iDfPiDeDiDeBiDiNiDePjFfMiOkGiOjOiKnEiBeC_xHqqkZx_
	for (;;)
	{
		while (*lpCmdLine == ' ' || *lpCmdLine == '\t') lpCmdLine++;
		if (*lpCmdLine == '\0') break;
		if (strncmp(lpCmdLine, "x=", 2) == 0)
		{
			lpCmdLine += 2;
			g_lX = strtol(lpCmdLine, &lpCmdLine, 10);
		} else
		if (strncmp(lpCmdLine, "y=", 2) == 0)
		{
			lpCmdLine += 2;
			g_lY = strtol(lpCmdLine, &lpCmdLine, 10);
		} else
		if (strncmp(lpCmdLine, "m=", 2) == 0)
		{
			lpCmdLine += 2;
			iMillisec = strtol(lpCmdLine, &lpCmdLine, 10);
		} else
//----- 06.02.27 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
		if (strncmp(lpCmdLine, "h=", 2) == 0)
		{
			lpCmdLine += 2;
			g_hwndFrom = (HWND)strtoul(lpCmdLine, &lpCmdLine, 10);
		} else
//----- 06.02.27 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
		{
			strcpy(g_szMessage, lpCmdLine);
			lpCmdLine = "";
		}
	}

	MSG msg;
// 01.06.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	HACCEL hAccelTable;

	// _xZkqqHx_iDePiDiNiBfLiDgPiDiL_xHqqkZx_ _xZkqqHx_iDfIiDgHiDiKiDjDiDePiCpAiPiJiKpKiJlLiClFiCnMiClH_xHqqkZx_
	LoadString(hInstance, IDS_APP_TITLE, g_szTitle, MAX_LOADSTRING);
	LoadString(hInstance, IDS_MSGPANEL, g_szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// _xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCmMiPiJiKpKiJlLiCpAiNhDiCkCiCnMiClH_xHqqkZx_:
	HWND hWnd = InitInstance(hInstance, nCmdShow);
	if (hWnd == NULL)
	{
		return FALSE;
	}
	// _xZkqqHx_iCfBjFgCiKnEjFfMiOkGiBeC_xHqqkZx_
	SetTimer(hWnd, 1, iMillisec, NULL);

// 01.06.20 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDS_MSGPANEL);

	// _xZkqqHx_iDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDiLiBfLiDhG_xHqqkZx_:
	while (GetMessage(&msg, NULL, 0, 0))
	{
//----- 01.06.20 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg))
//		{
//			TranslateMessage(&msg);
//			DispatchMessage(&msg);
//		}
//----- 01.06.20 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
			TranslateMessage(&msg);
			DispatchMessage(&msg);
//----- 01.06.20 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	}
	return msg.wParam;
} // WinMain.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MyRegisterClass
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeFiDeCiDjDiDgIiDeF_xHqqkZx_ _xZkqqHx_iDeOiDiJiDfIiCmMjDgPjIfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCkIiCoGiCnBiClLiCmMiOgHjHhAiCmNiClBiCmMiDfCiBfLiDgIiCpA_xHqqkZx_ Windows 95 _xZkqqHx_iCmFjAoGiCmJjCmHiJmBiClDiCoKiClN_xHqqkZx_
 *			'RegisterClassEx' _xZkqqHx_iKnGjAjEiCmG_xHqqkZx_ Win32 _xZkqqHx_iDfGiDfIiDgFiDiAiCmMiMnNiKlHjAkLiCpAjFnLiOjNiClFiClNiCkCiPoKiNiHiCmJ_xHqqkZx_
 *			_xZkqqHx_iCmMiCnNjFeLjHhGiCmGiCmIiCoIiCnMiClHiBeCiDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCkKiBeBiDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCmJiKnGjIeBjFhEiCkP_xHqqkZx_
 *			_xZkqqHx_iCoHiCoKiClNiDfIiDiCiBfLiDiL_xHqqkZx_ _xZkqqHx_iDeBiDeDiDfCiDjDiCpAiOoGjDlOiCmFiCkLiCoJiCoGiCkEiBeBiClBiCmMiKnGjAjEiCpAiMmEiCnBiPgPiClHiClBiCmGiCmN_xHqqkZx_
 *			_xZkqqHx_iPgEjHhGiCmFiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
ATOM MyRegisterClass (HINSTANCE hInstance)
{
	WNDCLASSEX wcex;

	wcex.cbSize = sizeof(WNDCLASSEX); 

	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, (LPCTSTR)IDI_MSGPANEL);
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
// 01.06.19 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	wcex.lpszMenuName	= (LPCSTR)IDS_MSGPANEL;
	wcex.lpszMenuName	= (LPCSTR)NULL;
	wcex.lpszClassName	= g_szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

	return RegisterClassEx(&wcex);
} // MyRegisterClass.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	InitInstance
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDeDiDjDiDfIiDfOiDjDiDfI_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiLiCmMjFnLjBlGiCmGiDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMiNoMjAkMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iClBiCmMiKnGjAjEiCmFiCmNiBeBiDeDiDjDiDfIiDfOiDjDiDfI_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiLiCpAiDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJjFnLjBlGiClFiBeB_xHqqkZx_
 *			_xZkqqHx_iDhGiDiNiDePiDiJiDiAiCmMiDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCpAiNoMjAkMiClFjFfMiOkGiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HWND InitInstance (HINSTANCE hInstance, int nCmdShow)
{
	HWND hWnd;
	g_hInstance = hInstance; // _xZkqqHx_iDePiDiNiBfLiDgPiDiLjFmPjAjEiCmJiDeDiDjDiDfIiDfOiDjDiDfI_xHqqkZx_ _xZkqqHx_iDgOiDjDiDgIiDiLiCpAjFnLjBlGiClFiCnMiClH_xHqqkZx_
//----- 01.06.19 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//   hWnd = CreateWindow(g_szWindowClass, g_szTitle, WS_OVERLAPPEDWINDOW,
//      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
//----- 01.06.19 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	hWnd = CreateWindowEx(WS_EX_TOPMOST, g_szWindowClass, g_szTitle, WS_POPUPWINDOW,
						g_lX, g_lY, 100, 100, NULL, NULL, hInstance, NULL);

	if (hWnd == NULL)
	{
		return NULL;
	}
	// _xZkqqHx_iDgFiDeMiDfIiDgHiCkJiCoHiDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAiMhGiOfKiBeC_xHqqkZx_
	SIZE size;
	CalcWindowSize(size, hWnd, g_szMessage);
	// _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAjAnNjCoIiBeC_xHqqkZx_
	MoveWindow(hWnd, g_lX - size.cx / 2, g_lY - size.cy / 2, size.cx, size.cy, TRUE);
	// _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCpAjFfMiOkGiBjFiNfIjAfGiBeC_xHqqkZx_
	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);
	return hWnd;
} // InitInstance.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	WndProc
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMiDiBiDgCiDfKiBfLiDfHiCpAiPiIjHjNiClFiCnMiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	WM_COMMAND	- _xZkqqHx_iDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjD_xHqqkZx_ _xZkqqHx_iDiBiDgKiDiFiBfLiCmMiPiIjHjN_xHqqkZx_
 *			WM_PAINT	- _xZkqqHx_iDiBiDeDiDjD_xHqqkZx_ _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMjFgAiJoG_xHqqkZx_
 *			WM_DESTROY	- _xZkqqHx_iPeJjHlJiDiBiDgCiDfKiBfLiDfHiCmMjCmKjCgNiCmGiDiKiDfOiBfLiDjD_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	LRESULT result = 0;
	switch (message)
	{
		case WM_ACTIVATEAPP:
			if (wParam)
			{
				// Active_xZkqqHx_iCmJiCmIiCmBiClNiOjOiBeBiClLiCoKiCnMiCmF_xHqqkZx_Active_xZkqqHx_iClOiCmBiClNiDeBiDhGiDiKiCpAiNmEiCnBiDeBiDeOiDgFiDeCiDhFiCmJiBeC_xHqqkZx_
// 06.02.27 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//				HWND hWndOwner = GetThreadTopWnd(lParam);
				HWND hWndOwner = (g_hwndFrom != NULL) ? g_hwndFrom : GetThreadTopWnd(lParam);
				SetForegroundWindow(hWndOwner);

//----- 06.02.27 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//				// _xZkqqHx_iDgFiDfIiDgHiBeC_xHqqkZx_
//				_TCHAR sz[1000];
//				_ultoa(DWORD(hWndOwner), sz, 16);
//				MessageBox(NULL, sz, NULL, MB_OK);
//----- 06.02.27 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

			}
			break;
		case WM_LBUTTONDOWN:
		case WM_RBUTTONDOWN:
		case WM_TIMER:
		case WM_DESTROY:
			PostQuitMessage(0);
			break;
		case WM_PAINT:
		  {
			PAINTSTRUCT ps;
			HDC hDC = BeginPaint(hWnd, &ps);
			// TODO: _xZkqqHx_iClBiCmMiImKjChFiCmJjFgAiJoGjHhAiCmMiDfCiBfLiDgIiCpAjCmHiJmBiClFiCmEiCkNiClOiClDiCkC_xHqqkZx_...
			// GUI_xZkqqHx_iDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeBjAnNjCoIiClHiCoJiBeC_xHqqkZx_
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//			HGDIOBJ hFont = GetStockObject(DEFAULT_GUI_FONT);
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
			HGDIOBJ hFont = CreateFontIndirect(&GetLogFont());
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
			HGDIOBJ hOldFont = SelectObject(hDC, hFont);
			RECT rect;
			GetClientRect(hWnd, &rect);
			rect.left += 5;
			rect.top += 5;
			DrawText(hDC, g_szMessage, strlen(g_szMessage), &rect, DT_LEFT);
			// _xZkqqHx_iDhEiDeIiDjDiDgHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
		    SelectObject(hDC, hOldFont);
			// _xZkqqHx_iDhEiDeIiDjDiDgHiCpAiNoNiPjMiBeC_xHqqkZx_
			DeleteObject(hFont);
			EndPaint(hWnd, &ps);
			break;
		  }
		default:
			result = DefWindowProc(hWnd, message, wParam, lParam);
	}
	return result;
} // WndProc.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	CalcWindowSize
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFfMiOkGjFlGiOjKjHpBiCmGiCgGiChEiCgIiDhEiDeIiDjDiDgHiCkJiCoHiBeBiDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAiMhGiOfKiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	size	:_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiDfEiDeDiDfJiCpAjFnEiClHiBeC_xHqqkZx_
 *			hWnd	:_xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCpAiOhHjCoIiBeC_xHqqkZx_
 *			tcpStr	:_xZkqqHx_jFfMiOkGjFlGiOjKjHpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.06.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void CalcWindowSize (SIZE& size, HWND hWnd, const TCHAR* tcpStr)
{
	size.cx = 0;
	size.cy = 0;
	// _xZkqqHx_jFgAiJoGiCmJiOgHiCoNiCoKiCoJ_xHqqkZx_HDC_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	PAINTSTRUCT ps;
	HDC hDC = BeginPaint(hWnd, &ps);
	//----- _xZkqqHx_iDhEiDeIiDjDiDgHiCmMiNiCiClDiCpAiLiBiCnPiCoJ_xHqqkZx_ -----
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	HGDIOBJ hObj = GetCurrentObject(hDC, OBJ_FONT);
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// GUI_xZkqqHx_iDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeBjAnNjCoIiClHiCoJiBeC_xHqqkZx_
//	HGDIOBJ hFont = GetStockObject(DEFAULT_GUI_FONT);
//	LOGFONT logFont;
//	GetObject(hFont, sizeof(logFont), &logFont);
//	const int iHeight = labs(logFont.lfHeight);
//	hFont = SelectObject(hDC, hFont);
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// GUI_xZkqqHx_iDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeBjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	HGDIOBJ hFont = CreateFontIndirect(&GetLogFont());
	HGDIOBJ hOldFont = SelectObject(hDC, hFont);
	const int iHeight = labs(GetLogFont().lfHeight);
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//----- 01.11.15 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	for (;;)
	{
		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMiNiCiClDiCpAiJmBiOfKiBeC_xHqqkZx_
		size.cy += iHeight;
		// _xZkqqHx_iDeFiDeCiDjDiDgIiDeFiCmMjFjNiCpAjAnNjCoIiBeC_xHqqkZx_
		int iWidth = CalcStrWidth(hDC, tcpStr);
		if (size.cx < iWidth) size.cx = iWidth;
		if (*tcpStr == _T('\r')) tcpStr++;
		if (*tcpStr == _T('\n')) tcpStr++;
		if (*tcpStr == _T('\0')) break;
	}
	// _xZkqqHx_iDhEiDeIiDjDiDgHiCpAiMlDiCmJjGnPiClHiBeC_xHqqkZx_
    SelectObject(hDC, hOldFont);
	// _xZkqqHx_iDhEiDeIiDjDiDgHiCpAiNoNiPjMiBeC_xHqqkZx_
	DeleteObject(hFont);
	// HDC_xZkqqHx_iCpAiKeKjFpKiBeC_xHqqkZx_
	EndPaint(hWnd, &ps);
	size.cx += 15;
	size.cy += 15;
} // CalcWindowSize.

const LOGFONT& GetLogFont ()
{
	static LOGFONT s_logFont = { 0 };
	if (s_logFont.lfFaceName[0] == _T('\0'))
	{
//----- 06.05.01 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		_TCHAR szTmp[LF_FACESIZE + 100];
//		LoadString(g_hInstance, IDS_FONT_WEIGHT, szTmp, 100);
//		s_logFont.lfWeight = _tcstol(szTmp, NULL, 10);
//		LoadString(g_hInstance, IDS_FONT_CHAR_SET, szTmp, 100);
//		s_logFont.lfCharSet = _tcstol(szTmp, NULL, 10);
//		LoadString(g_hInstance, IDS_FONT_PITCH_AND_FAMILY, szTmp, 100);
//		s_logFont.lfPitchAndFamily = _tcstol(szTmp, NULL, 10);
//		LoadString(g_hInstance, IDS_FONT_FACE_NAME, szTmp, LF_FACESIZE);
//		_tcscpy(s_logFont.lfFaceName, szTmp);
//
//		// GUI_xZkqqHx_iDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeBjAnNjCoIiClHiCoJiBeC_xHqqkZx_
//		HGDIOBJ hFont = GetStockObject(DEFAULT_GUI_FONT);
//		LOGFONT lfGuiFont;
//		GetObject(hFont, sizeof(lfGuiFont), &lfGuiFont);
//		s_logFont.lfHeight = lfGuiFont.lfHeight * 1.5;
//----- 06.05.01 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		// GUI_xZkqqHx_iDhEiDeIiDjDiDgHiCpAiOoGjDlOiBeBjAnNjCoIiClHiCoJiBeC_xHqqkZx_
		HGDIOBJ hFont = GetStockObject(DEFAULT_GUI_FONT);
		GetObject(hFont, sizeof(s_logFont), &s_logFont);
		s_logFont.lfHeight = long(double(s_logFont.lfHeight) * 1.5);
//----- 06.05.01 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	}
	return s_logFont;
} // GetLogFont.


