Hi
In addition to using your great Classic Shell in Windows 8.1, I also used it in Win7PE, Win8PE.
Everything works beautifully in true Windows
But in PE, I can not use the latest version. The latest version that fully works is version 3.6.1
In PE v3.6.2 and following, wait 1 minute then 5 seconds and then it hangs.
I'm not really a developer even if I play a little with AutoIT. However, I tried a bit in VS2008SP1.
If I change a little ClassicStartMenu.cpp versions 3.6.2 -> 3.6.8 by taking a part of what was done in 3.6.1, Then ClassicShell 3.6.2 -> 3.6.8 works in my WinPE
.
I can not test with the following versions, the sources are no longer shared, and you have 1000x reasons
, but maybe it can also work in PE with the same changes.
Can you enlighten me on improvements made on ClassicStartMenu.cpp between v3.6.1 and later versions ?
Does something can be made to work in both real windows and WinPE ?
Line 28
Code:
enum THookMode
{
HOOK_NONE, // don't hook Explorer, running as a separate exe
HOOK_NORMAL, // hook Explorer normally, no retry
HOOK_STARTUP, // retry to hook Explorer
};
static HWND HookStartMenu( THookMode mode )
{
HMODULE hHookModule=GetModuleHandle(L"ClassicStartMenuDLL.dll");
// find the Progman window and the start button
HWND progWin;
bool bFindAppManager=(mode==HOOK_STARTUP && GetWinVersion()>=WIN_VER_WIN8);
for (int i=0;i<120;i++) // retry for 1 minute
{
if (bFindAppManager)
bFindAppManager=!FindWindow(L"ApplicationManager_DesktopShellWindow",NULL);
if (!bFindAppManager)
{
progWin=FindWindowEx(NULL,NULL,L"Progman",NULL);
if (progWin) break;
if (mode!=HOOK_STARTUP) return NULL; // the Progman window may not be created yet (if Explorer is currently restarting)
}
Sleep(500);
}
DWORD process;
DWORD thread=GetWindowThreadProcessId(progWin,&process);
for (int i=0;i<10;i++) // retry for 5 sec
{
if (FindTaskBar(process)) break;
if (mode!=HOOK_STARTUP) return NULL; // the taskbar may not be created yet (if Explorer is currently restarting)
Sleep(500);
}
if (mode==HOOK_NONE)
return ToggleStartMenu(g_StartButton,false);
==>
Code:
static HWND HookStartMenu( bool bHookExplorer )
{
HMODULE hHookModule=GetModuleHandle(L"ClassicStartMenuDLL.dll");
// find the Progman window and the start button
HWND progWin=FindWindowEx(NULL,NULL,L"Progman",NULL);
if (!progWin) return NULL; // the Progman window may not be created yet (if Explorer is currently restarting)
Line 147
Code:
HookStartMenu(HOOK_NORMAL);
==>
HookStartMenu(true);
Line 288
Code:
HWND menu=HookStartMenu(bHookExplorer?HOOK_STARTUP:HOOK_NONE);
==>
HWND menu=HookStartMenu(bHookExplorer);
Thanks