I need to make sure that explorer.exe
runs as a system shell. What I need to do is:
Winlogon\Shell
) with explorer.exe
explorer.exe
(as shell)Between the last two steps is a race:
So the question is, are there any events/mutexes/callbacks I can call to make sure that explorer is initialized as shell?
The best I managed to do is to wait for the tray window like:
while(!FindWindow("Shell_TrayWnd", NULL)) {
sleep(250);
}
Which seems kinda sloppy, is there a better way?
I would not even try to do this. You should create a new winsta0 desktop (Win32 API CreateDesktop), start your Kiosk application on that desktop and switch to it. That way you leave the default desktop alone, running explorer, and can get back to it if you need to. We had much success doing this in a kiosk project we built.