Author: arty
Date: Wed Jun 13 01:39:02 2012
New Revision: 56728
URL:
http://svn.reactos.org/svn/reactos?rev=56728&view=rev
Log:
[REGEDIT]
Implement silent mode so the winetest can run.
Modified:
trunk/reactos/base/applications/regedit/regedit.c
Modified: trunk/reactos/base/applications/regedit/regedit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
==============================================================================
--- trunk/reactos/base/applications/regedit/regedit.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/regedit/regedit.c [iso-8859-1] Wed Jun 13 01:39:02
2012
@@ -132,7 +132,7 @@
(*command_line) += pos;
}
-BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
+BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
{
TCHAR szTitle[256], szText[256];
switch (action)
@@ -166,7 +166,8 @@
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
LoadString(hInst, IDS_IMPORTED_OK, szText, sizeof(szTitle));
/* show successful import */
- MessageBox(NULL, szText, szTitle, MB_OK);
+ if (!silent)
+ MessageBox(NULL, szText, szTitle, MB_OK);
}
break;
}
@@ -239,6 +240,7 @@
BOOL ProcessCmdLine(LPWSTR lpCmdLine)
{
+ BOOL silent = FALSE;
REGEDIT_ACTION action = ACTION_UNDEF;
LPWSTR s = lpCmdLine; /* command line pointer */
WCHAR ch = *s; /* current character */
@@ -254,7 +256,11 @@
chu = (WCHAR)towupper(ch);
if (!ch2 || iswspace(ch2))
{
- if (chu == L'S' || chu == L'V')
+ if (chu == L'S')
+ {
+ silent = TRUE;
+ }
+ else if (chu == L'V')
{
/* ignore these switches */
}
@@ -321,7 +327,7 @@
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
LoadString(hInst, IDS_IMPORT_PROMPT, szText, sizeof(szTitle));
/* request import confirmation */
- if (MessageBox(NULL, szText, szTitle, MB_YESNO) == IDYES)
+ if (silent || MessageBox(NULL, szText, szTitle, MB_YESNO) == IDYES)
{
action = ACTION_ADD;
}
@@ -330,5 +336,5 @@
if (action == ACTION_UNDEF)
return FALSE;
- return PerformRegAction(action, s);
-}
+ return PerformRegAction(action, s, silent);
+}