mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
hide login screen to make the login on XP faster
svn path=/trunk/; revision=14350
This commit is contained in:
parent
742ddb108f
commit
cd0596ffa4
1 changed files with 28 additions and 1 deletions
|
@ -705,6 +705,19 @@ int main(int argc, char* argv[])
|
|||
#endif // __MINGW && UNICODE
|
||||
|
||||
|
||||
static bool SetShellReadyEvent(LPCTSTR evtName)
|
||||
{
|
||||
HANDLE hEvent = OpenEvent(EVENT_MODIFY_STATE, FALSE, evtName);
|
||||
if (!hEvent)
|
||||
return false;
|
||||
|
||||
SetEvent(hEvent);
|
||||
CloseHandle(hEvent);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)
|
||||
{
|
||||
CONTEXT("WinMain()");
|
||||
|
@ -758,10 +771,14 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
|||
}
|
||||
|
||||
startup_desktop = TRUE;
|
||||
} else
|
||||
} else {
|
||||
// create desktop window and task bar only, if there is no other shell and we are
|
||||
// the first explorer instance
|
||||
// MS Explorer looks additionally into the registry entry HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\shell,
|
||||
// to decide wether it is currently configured as shell application.
|
||||
startup_desktop = !any_desktop_running;
|
||||
}
|
||||
|
||||
|
||||
bool autostart = !any_desktop_running;
|
||||
|
||||
|
@ -803,6 +820,15 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (startup_desktop) {
|
||||
// hide the XP login screen (Credit to Nicolas Escuder)
|
||||
// another undocumented event: "Global\\msgina: ReturnToWelcome"
|
||||
if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
|
||||
SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
|
||||
}
|
||||
|
||||
|
||||
bool use_gdb_stub = false; // !IsDebuggerPresent();
|
||||
|
||||
if (_tcsstr(lpCmdLine,TEXT("-debug")))
|
||||
|
@ -842,6 +868,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL
|
|||
g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
|
||||
#endif
|
||||
|
||||
/**TODO launching autostart programs can be moved into a background thread. */
|
||||
if (autostart) {
|
||||
char* argv[] = {"", "s"}; // call startup routine in SESSION_START mode
|
||||
startup(2, argv);
|
||||
|
|
Loading…
Reference in a new issue