winecfg: Make load_string public
Frank Richter
frank.richter at gmail.com
Tue Aug 15 23:22:54 CDT 2006
-------------- next part --------------
>From 6047f03a619fa58f54a4d249a3a6c366593b5ba1 Mon Sep 17 00:00:00 2001
From: Frank Richter frank.richter at gmail.com <frank.richter at gmail.com>
Date: Wed, 16 Aug 2006 05:27:23 +0200
Subject: [PATCH] winecfg: Make load_string public
---
programs/winecfg/main.c | 15 ---------------
programs/winecfg/winecfg.c | 15 +++++++++++++++
programs/winecfg/winecfg.h | 3 +++
3 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/programs/winecfg/main.c b/programs/winecfg/main.c
index d2b3100..6fc77f7 100644
--- a/programs/winecfg/main.c
+++ b/programs/winecfg/main.c
@@ -78,21 +78,6 @@ AboutDlgProc (HWND hDlg, UINT uMsg, WPAR
return FALSE;
}
-static WCHAR* load_string (UINT id)
-{
- WCHAR buf[100];
- int len;
- WCHAR* newStr;
-
- LoadStringW (GetModuleHandle (NULL), id, buf, sizeof(buf)/sizeof(buf[0]));
-
- len = lstrlenW (buf);
- newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR));
- memcpy (newStr, buf, len * sizeof (WCHAR));
- newStr[len] = 0;
- return newStr;
-}
-
#define NUM_PROPERTY_PAGES 7
static INT_PTR
diff --git a/programs/winecfg/winecfg.c b/programs/winecfg/winecfg.c
index 2d70fca..dfa5aeb 100644
--- a/programs/winecfg/winecfg.c
+++ b/programs/winecfg/winecfg.c
@@ -72,6 +72,21 @@ void set_window_title(HWND dialog)
}
+WCHAR* load_string (UINT id)
+{
+ WCHAR buf[100];
+ int len;
+ WCHAR* newStr;
+
+ LoadStringW (GetModuleHandle (NULL), id, buf, sizeof(buf)/sizeof(buf[0]));
+
+ len = lstrlenW (buf);
+ newStr = HeapAlloc (GetProcessHeap(), 0, (len + 1) * sizeof (WCHAR));
+ memcpy (newStr, buf, len * sizeof (WCHAR));
+ newStr[len] = 0;
+ return newStr;
+}
+
/**
* get_config_key: Retrieves a configuration value from the registry
*
diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h
index 53fe9ee..5332abe 100644
--- a/programs/winecfg/winecfg.h
+++ b/programs/winecfg/winecfg.h
@@ -58,6 +58,9 @@ BOOL reg_key_exists(HKEY root, const cha
void apply(void);
char **enumerate_values(HKEY root, char *path);
+/* Load a string from the resources. Allocated with HeapAlloc (GetProcessHeap()) */
+WCHAR* load_string (UINT id);
+
/* returns a string of the form "AppDefaults\\appname.exe\\section", or just "section" if
the user is editing the global settings.
--
1.4.1.1
More information about the wine-patches
mailing list