Don't use hardcoded strings in the configuration message box. Use string resources instead.

svn path=/trunk/; revision=29135
This commit is contained in:
Eric Kohl 2007-09-22 09:09:57 +00:00
parent 1e19b02082
commit 1c85a28f50
4 changed files with 36 additions and 12 deletions

View file

@ -0,0 +1,8 @@
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE DISCARDABLE
BEGIN
IDS_DESCRIPTION "Default ScreenSaver"
IDS_TITLE "About"
IDS_TEXT "No options need to be set."
END

View file

@ -1,2 +1,4 @@
#define IDS_DESCRIPTION 1 #define IDS_DESCRIPTION 1
#define IDS_TITLE 2
#define IDS_TEXT 3

View file

@ -19,6 +19,7 @@
#include <windows.h> #include <windows.h>
#include <tchar.h> #include <tchar.h>
#include "resource.h"
#define APPNAME _T("Scrnsave") #define APPNAME _T("Scrnsave")
@ -151,6 +152,28 @@ void ParseCommandLine(PSTR szCmdLine, int *chOption, HWND *hwndParent)
*hwndParent = 0; *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, int WINAPI WinMain (HINSTANCE hInst,
HINSTANCE hPrev, HINSTANCE hPrev,
LPSTR lpCmdLine, LPSTR lpCmdLine,
@ -179,10 +202,7 @@ int WINAPI WinMain (HINSTANCE hInst,
case 'c': case 'c':
default: default:
MessageBox(0, Configure();
_T("No options need to be set."),
_T("About"),
MB_OK | MB_ICONWARNING);
return 0; return 0;
} }

View file

@ -10,10 +10,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include <reactos/version.rc> #include <reactos/version.rc>
#include "lang/en-US.rc"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
STRINGTABLE DISCARDABLE
BEGIN
IDS_DESCRIPTION "Default ScreenSaver"
END