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

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

diff --git a/reactos/base/applications/screensavers/starfield/lang/en-US.rc b/reactos/base/applications/screensavers/starfield/lang/en-US.rc
new file mode 100644 (file)
index 0000000..1d2ad6d
--- /dev/null
@@ -0,0 +1,8 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_DESCRIPTION "Starfield ScreenSaver"
+    IDS_TITLE       "About"
+    IDS_TEXT        "No options need to be set."
+END
index dae01ee..d197357 100644 (file)
@@ -1 +1,4 @@
-#define IDS_DESCRIPTION                 1\r
+\r
+#define IDS_DESCRIPTION 1\r
+#define IDS_TITLE       2\r
+#define IDS_TEXT        3\r
index 846a03a..0ce8d80 100644 (file)
@@ -315,6 +315,27 @@ void ParseCommandLine(PSTR szCmdLine, int *chOption, HWND *hwndParent)
                *hwndParent = 0;\r
 }\r
 \r
+void Configure(void)\r
+{\r
+       TCHAR szTitle[256];\r
+       TCHAR szText[256];\r
+\r
+       LoadString(hInstance,\r
+                  IDS_TITLE,\r
+                  szTitle,\r
+                  256);\r
+\r
+       LoadString(hInstance,\r
+                  IDS_TEXT,\r
+                  szText,\r
+                  256);\r
+\r
+       MessageBox(0,\r
+                  szText,\r
+                  szTitle,\r
+                  MB_OK | MB_ICONWARNING);\r
+}\r
+\r
 int WINAPI WinMain (HINSTANCE hInst,\r
                     HINSTANCE hPrev,\r
                     LPSTR lpCmdLine,\r
@@ -343,10 +364,7 @@ int WINAPI WinMain (HINSTANCE hInst,
 \r
                case 'c':\r
                default:\r
-                       MessageBox(0,\r
-                                  _T("No options need to be set."),\r
-                                  _T("About"),\r
-                                  MB_OK | MB_ICONWARNING);\r
+                       Configure();\r
                        return 0;\r
        }\r
 \r
index b370dc1..17dcc0a 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         "Starfield ScreenSaver"
-END
+#include "lang/en-US.rc"