wordpad: Set default font
Alexander Nicolaysen Sørnes
alex at thehandofagony.com
Mon Feb 26 11:32:11 CST 2007
Set the default font to 'Times New Roman', like native does. Bold and italic
does not work on the otherwise used System font.
Regards,
Alexander N. Sørnes
-------------- next part --------------
From 0ab13a7ecd2b25680e192aa318cc01091e42a811 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Alexander_Nicolaysen_S=C3=B8rnes?= <alex at thehandofagony.com>
Date: Mon, 26 Feb 2007 18:28:48 +0100
Subject: [PATCH] wordpad: Set default font
---
programs/wordpad/wordpad.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 0d45cb7..5c748e3 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -253,6 +253,21 @@ static void HandleCommandLine(LPWSTR cmdline)
MessageBox(hMainWnd, "Printing not implemented", "WordPad", MB_OK);
}
+static void DoDefaultFont()
+{
+ WCHAR szFaceName[LF_FACESIZE] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n',0};
+ CHARFORMAT2W fmt;
+
+ ZeroMemory(&fmt, sizeof(fmt));
+
+ fmt.cbSize = sizeof(fmt);
+ fmt.dwMask = CFM_FACE;
+
+ lstrcpyW(fmt.szFaceName, szFaceName);
+
+ SendMessage(hEditorWnd, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&fmt);
+}
+
static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
{
HWND hToolBarWnd, hReBarWnd;
@@ -332,6 +347,8 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
SetFocus(hEditorWnd);
SendMessage(hEditorWnd, EM_SETEVENTMASK, 0, ENM_SELCHANGE);
+ DoDefaultFont();
+
DoLoadStrings();
return 0;
--
1.4.4.4
More information about the wine-patches
mailing list