CreateDesktop and Explorer

CreateDesktop and Explorer

Post by Gregoire Genti » Mon, 30 Jun 2003 09:07:42



Hello,

My program creates a second desktop using CreateDesktop and then launches
explorer. Something like:

CreateDesktop( DESKTOP_VIRTUAL_NAME, NULL, NULL, DF_ALLOWOTHERACCOUNTHOOK,
MAXIMUM_ALLOWED, NULL );
CreateProcess( "C:\\WINNT\\Explorer.exe", NULL, NULL, NULL, FALSE, 0, NULL,
NULL, &si, &pi );

Sometimes (5% of the cases), the new explorer relaunches all programs from
the run HKCU and HKLM keys and from the start menu. What is it happening
sometimes and not "never or all the time"? What does explorer (or winlogon
or I-don't-know-what) loose which forces the new explorer to relaunch
everything?

Many thanks by advance,

Gregoire

 
 
 

CreateDesktop and Explorer

Post by Jim Barr » Wed, 02 Jul 2003 08:42:57



> Sometimes (5% of the cases), the new explorer relaunches
> all programs from the run HKCU and HKLM keys and from
> the start menu. What is it happening sometimes and not "never
> or all the time"? What does explorer (or winlogon or
> I-don't-know-what) loose which forces the new explorer to
> relaunch everything?

Explorer runs the startup items unless it finds the subkey 'StartupHasBeenRun' under

HKEY_CURRENT_USER
 Software
  Microsoft
   Windows
    CurrentVersion
     Explorer
      SessionInfo
       <SessionID>

where <SessionID> is what GetTokenInformation returns in the AuthenticationId member of the TOKEN_STATISTICS structure. At this point I'm not sure why Explorer would sometimes run the startup items and sometimes not.

--
Jim Barry, MVP for Windows SDK

 
 
 

CreateDesktop and Explorer

Post by Gregoire Genti » Wed, 02 Jul 2003 10:56:53


Right. That answers my question. Many thanks for your help.

Gregoire



> Sometimes (5% of the cases), the new explorer relaunches
> all programs from the run HKCU and HKLM keys and from
> the start menu. What is it happening sometimes and not "never
> or all the time"? What does explorer (or winlogon or
> I-don't-know-what) loose which forces the new explorer to
> relaunch everything?

Explorer runs the startup items unless it finds the subkey
'StartupHasBeenRun' under

HKEY_CURRENT_USER
 Software
  Microsoft
   Windows
    CurrentVersion
     Explorer
      SessionInfo
       <SessionID>

where <SessionID> is what GetTokenInformation returns in the
AuthenticationId member of the TOKEN_STATISTICS structure. At this point I'm
not sure why Explorer would sometimes run the startup items and sometimes
not.

--
Jim Barry, MVP for Windows SDK

 
 
 

CreateDesktop and Explorer

Post by Gregoire Genti » Thu, 03 Jul 2003 07:17:42


Interesting also to notice that this key is volatile...

Gregoire



> Sometimes (5% of the cases), the new explorer relaunches
> all programs from the run HKCU and HKLM keys and from
> the start menu. What is it happening sometimes and not "never
> or all the time"? What does explorer (or winlogon or
> I-don't-know-what) loose which forces the new explorer to
> relaunch everything?

Explorer runs the startup items unless it finds the subkey
'StartupHasBeenRun' under

HKEY_CURRENT_USER
 Software
  Microsoft
   Windows
    CurrentVersion
     Explorer
      SessionInfo
       <SessionID>

where <SessionID> is what GetTokenInformation returns in the
AuthenticationId member of the TOKEN_STATISTICS structure. At this point I'm
not sure why Explorer would sometimes run the startup items and sometimes
not.

--
Jim Barry, MVP for Windows SDK