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

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

diff --git a/reactos/base/applications/screensavers/logon/lang/en-US.rc b/reactos/base/applications/screensavers/logon/lang/en-US.rc
new file mode 100644 (file)
index 0000000..d1f616a
--- /dev/null
@@ -0,0 +1,8 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+    IDS_DESCRIPTION "Logon ScreenSaver"
+    IDS_TITLE       "About"
+    IDS_TEXT        "No options need to be set."
+END
index 79c7da4..b79e773 100644 (file)
@@ -270,6 +270,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
@@ -298,10 +319,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 07c5fd7..a6c2705 100644 (file)
@@ -13,9 +13,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 IDB_WORKSTATION BITMAP DISCARDABLE     "res/0.bmp"
 IDB_SERVER     BITMAP DISCARDABLE      "res/1.bmp"
 
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_DESCRIPTION         "Logon ScreenSaver"
-END
+#include "lang/en-US.rc"
index 6854273..ddb0f46 100644 (file)
@@ -1,4 +1,6 @@
 \r
-#define IDS_DESCRIPTION                 1\r
-#define IDB_WORKSTATION                        0x100\r
-#define IDB_SERVER                     0x200\r
+#define IDS_DESCRIPTION 1\r
+#define IDS_TITLE       2\r
+#define IDS_TEXT        3\r
+#define IDB_WORKSTATION 0x100\r
+#define IDB_SERVER      0x200\r