Ivan Sinitsin : winefile: Save font settings in registry.

Alexandre Julliard julliard at winehq.org
Fri Dec 21 07:28:24 CST 2007


Module: wine
Branch: master
Commit: 7a465ce9043336545d0b16c5c114be3b52580451
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7a465ce9043336545d0b16c5c114be3b52580451

Author: Ivan Sinitsin <ivan at etersoft.ru>
Date:   Thu Dec 20 16:15:16 2007 +0300

winefile: Save font settings in registry.

---

 programs/winefile/winefile.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 0574c37..4805a6b 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -66,6 +66,7 @@ static const WCHAR reg_start_x[] = { 's','t','a','r','t','X','\0'};
 static const WCHAR reg_start_y[] = { 's','t','a','r','t','Y','\0'};
 static const WCHAR reg_width[] = { 'w','i','d','t','h','\0'};
 static const WCHAR reg_height[] = { 'h','e','i','g','h','t','\0'};
+static const WCHAR reg_logfont[] = { 'l','o','g','f','o','n','t','\0'};
 
 enum ENTRY_TYPE {
 	ET_WINDOWS,
@@ -1645,6 +1646,7 @@ static windowOptions load_registry_settings(void)
 	DWORD type;
 	HKEY hKey;
 	windowOptions opts;
+	LOGFONT logfont;
 
         RegOpenKeyExW( HKEY_CURRENT_USER, registry_key,
                        0, KEY_QUERY_VALUE, &hKey );
@@ -1666,9 +1668,14 @@ static windowOptions load_registry_settings(void)
         if( RegQueryValueExW( hKey, reg_height, NULL, &type,
                               (LPBYTE) &opts.height, &size ) != ERROR_SUCCESS )
 		opts.height = CW_USEDEFAULT;
+	size=sizeof(logfont);
+	if( RegQueryValueExW( hKey, reg_logfont, NULL, &type,
+                              (LPBYTE) &logfont, &size ) != ERROR_SUCCESS )
+		GetObject(GetStockObject(DEFAULT_GUI_FONT),sizeof(logfont),&logfont);
 
 	RegCloseKey( hKey );
 
+	Globals.hfont = CreateFontIndirect(&logfont);
 	return opts;
 }
 
@@ -1677,6 +1684,7 @@ static void save_registry_settings(void)
 	WINDOWINFO wi;
 	HKEY hKey;
 	INT width, height;
+	LOGFONT logfont;
 
 	wi.cbSize = sizeof( WINDOWINFO );
 	GetWindowInfo(Globals.hMainWnd, &wi);
@@ -1704,6 +1712,9 @@ static void save_registry_settings(void)
                         (LPBYTE) &width, sizeof(DWORD) );
         RegSetValueExW( hKey, reg_height, 0, REG_DWORD,
                         (LPBYTE) &height, sizeof(DWORD) );
+        GetObject(Globals.hfont, sizeof(logfont), &logfont);
+        RegSetValueExW( hKey, reg_logfont, 0, REG_BINARY,
+                        (LPBYTE) &logfont, sizeof(LOGFONT) );
 
 	/* TODO: Save more settings here (List vs. Detailed View, etc.) */
 	RegCloseKey( hKey );




More information about the wine-cvs mailing list