[EXPLORER] Simplify the current-shell-is-explorer check when trying to start the auto-start programs, by using the existing code.

This commit is contained in:
Hermès Bélusca-Maïto
2018-06-22 16:34:16 +02:00
parent 0a8cd95cad
commit 12de9654b0
3 changed files with 11 additions and 23 deletions

View File

@@ -24,7 +24,7 @@
HINSTANCE hExplorerInstance;
HANDLE hProcessHeap;
HKEY hkExplorer = NULL;
BOOL IsSelfTheShell = FALSE;
BOOL bExplorerIsShell = FALSE;
class CExplorerModule : public CComModule
{
@@ -34,8 +34,8 @@ public:
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()
CExplorerModule gModule;
CAtlWinModule gWinModule;
CExplorerModule gModule;
CAtlWinModule gWinModule;
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize)
{
@@ -206,16 +206,18 @@ _tWinMain(IN HINSTANCE hInstance,
InitRSHELL();
TRACE("Explorer starting... Command line: %S\n", lpCmdLine);
#if !WIN7_COMPAT_MODE
TRACE("Explorer starting... Commandline: %S\n", lpCmdLine);
if (GetShellWindow() == NULL)
IsSelfTheShell = TRUE;
bExplorerIsShell = TRUE;
if (!IsSelfTheShell)
if (!bExplorerIsShell)
{
return StartWithCommandLine(hInstance);
}
#else
bExplorerIsShell = TRUE;
#endif
return StartWithDesktop(hInstance);