mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 04:06:22 +00:00
[REGEDIT]
Implement silent mode so the winetest can run. svn path=/trunk/; revision=56728
This commit is contained in:
parent
cdb1c62cd1
commit
eb169973ff
|
@ -132,7 +132,7 @@ void get_file_name(LPWSTR *command_line, LPWSTR file_name)
|
|||
(*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 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
|
|||
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 @@ static void error_unknown_switch(WCHAR chu, LPWSTR s)
|
|||
|
||||
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 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
|||
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 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
|||
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 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
|||
if (action == ACTION_UNDEF)
|
||||
return FALSE;
|
||||
|
||||
return PerformRegAction(action, s);
|
||||
return PerformRegAction(action, s, silent);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue