Don't use hardcoded strings in the configuration message box. Use string resources...
authorEric Kohl <eric.kohl@reactos.org>
Sat, 22 Sep 2007 11:20:25 +0000 (11:20 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 22 Sep 2007 11:20:25 +0000 (11:20 +0000)
svn path=/trunk/; revision=29136

reactos/base/applications/screensavers/cylfrac/cylfrac.c
reactos/base/applications/screensavers/cylfrac/cylfrac.rc
reactos/base/applications/screensavers/cylfrac/lang/en-US.rc [new file with mode: 0644]
reactos/base/applications/screensavers/cylfrac/resource.h

index 995f4d6..2ad3de5 100644 (file)
@@ -21,6 +21,7 @@
 #include <GL/gl.h>
 #include <GL/glu.h>
 #include <tchar.h>
+#include "resource.h"
 
 #define APPNAME _T("Cylfrac")
 #define wfactor 0.9
@@ -272,6 +273,27 @@ void ParseCommandLine(PSTR szCmdLine, int *chOption, HWND *hwndParent)
                *hwndParent = 0;
 }
 
+void Configure(void)
+{
+       TCHAR szTitle[256];
+       TCHAR szText[256];
+
+       LoadString(hInstance,
+                  IDS_TITLE,
+                  szTitle,
+                  256);
+
+       LoadString(hInstance,
+                  IDS_TEXT,
+                  szText,
+                  256);
+
+       MessageBox(0,
+                  szText,
+                  szTitle,
+                  MB_OK | MB_ICONWARNING);
+}
+
 int WINAPI WinMain (HINSTANCE hInst,
                     HINSTANCE hPrev,
                     LPSTR lpCmdLine,
@@ -297,10 +319,7 @@ int WINAPI WinMain (HINSTANCE hInst,
 
                case 'c':
                default:
-                       MessageBox(0,
-                                  _T("Cylinders fractal by unC0Rr.\nSpecial for ReactOS.\n"),
-                                  _T("About"),
-                                  MB_OK | MB_ICONINFORMATION);
+                       Configure();
                        return 0;
        }
 
index f083119..cf03aec 100644 (file)
@@ -10,10 +10,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 #include <reactos/version.rc>
 
-
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION         "Cylinders fractal"
-END
+#include "lang/en-US.rc"
diff --git a/reactos/base/applications/screensavers/cylfrac/lang/en-US.rc b/reactos/base/applications/screensavers/cylfrac/lang/en-US.rc
new file mode 100644 (file)
index 0000000..dbdfcea
--- /dev/null
@@ -0,0 +1,8 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_DESCRIPTION "Cylinders fractal"
+    IDS_TITLE       "About"
+    IDS_TEXT        "Cylinders fractal by unC0Rr.\nSpecial for ReactOS."
+END
index 8e67305..d197357 100644 (file)
@@ -1,2 +1,4 @@
 \r
-#define IDS_DESCRIPTION                 1\r
+#define IDS_DESCRIPTION 1\r
+#define IDS_TITLE       2\r
+#define IDS_TEXT        3\r