mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +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;
|
(*command_line) += pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
|
BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
|
||||||
{
|
{
|
||||||
TCHAR szTitle[256], szText[256];
|
TCHAR szTitle[256], szText[256];
|
||||||
switch (action)
|
switch (action)
|
||||||
|
@ -166,6 +166,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s)
|
||||||
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
|
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
|
||||||
LoadString(hInst, IDS_IMPORTED_OK, szText, sizeof(szTitle));
|
LoadString(hInst, IDS_IMPORTED_OK, szText, sizeof(szTitle));
|
||||||
/* show successful import */
|
/* show successful import */
|
||||||
|
if (!silent)
|
||||||
MessageBox(NULL, szText, szTitle, MB_OK);
|
MessageBox(NULL, szText, szTitle, MB_OK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -239,6 +240,7 @@ static void error_unknown_switch(WCHAR chu, LPWSTR s)
|
||||||
|
|
||||||
BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
||||||
{
|
{
|
||||||
|
BOOL silent = FALSE;
|
||||||
REGEDIT_ACTION action = ACTION_UNDEF;
|
REGEDIT_ACTION action = ACTION_UNDEF;
|
||||||
LPWSTR s = lpCmdLine; /* command line pointer */
|
LPWSTR s = lpCmdLine; /* command line pointer */
|
||||||
WCHAR ch = *s; /* current character */
|
WCHAR ch = *s; /* current character */
|
||||||
|
@ -254,7 +256,11 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
||||||
chu = (WCHAR)towupper(ch);
|
chu = (WCHAR)towupper(ch);
|
||||||
if (!ch2 || iswspace(ch2))
|
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 */
|
/* ignore these switches */
|
||||||
}
|
}
|
||||||
|
@ -321,7 +327,7 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
||||||
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
|
LoadString(hInst, IDS_APP_TITLE, szTitle, sizeof(szTitle));
|
||||||
LoadString(hInst, IDS_IMPORT_PROMPT, szText, sizeof(szTitle));
|
LoadString(hInst, IDS_IMPORT_PROMPT, szText, sizeof(szTitle));
|
||||||
/* request import confirmation */
|
/* request import confirmation */
|
||||||
if (MessageBox(NULL, szText, szTitle, MB_YESNO) == IDYES)
|
if (silent || MessageBox(NULL, szText, szTitle, MB_YESNO) == IDYES)
|
||||||
{
|
{
|
||||||
action = ACTION_ADD;
|
action = ACTION_ADD;
|
||||||
}
|
}
|
||||||
|
@ -330,5 +336,5 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine)
|
||||||
if (action == ACTION_UNDEF)
|
if (action == ACTION_UNDEF)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return PerformRegAction(action, s);
|
return PerformRegAction(action, s, silent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue