Posted By: GRiNSER | May 3rd, 2005 @ 1:58 PM
page 1 of 1
Comments: 21 | Views: 33590
GRiNSER
GRiNSER
GRiNSER puts a smile on your face :)
What annoys me most with all Win versions till Win XP is, when the explorer.exe crashes, everytime the whole taskbar also wents to desktop nirvana.
After recreating itself, half of the systray symbols get lost until i restart my machine. Sometimes i've to use the taskmanager to re-open an explorer instance to get the taskbar back and get back to work...

what i suggest for further Windows releases would be a seperation of the file browsing so called "explorer" windows and the taskbar itself on process level - i don't think that this is so hard to do for the devs but it would eliminate the IMO most annoying error after the blue screen of death...
W3bbo
W3bbo
The Master of Baiters
Windows already does that, but you need to enable it.

Control Panel > Folder Options > View > Advanced > "Launch Folder Windows in a separate process" <-- Check it

Problem solved at the cost of a few megs of RAM.
msemack
msemack
Embedded Systems Guy
If an app doesn't re-appear in the systray, it is the fault of the app, not of Windows Explorer.
Maurits
Maurits
AKA Matthew van Eerde
How do you figure?  Is there a WM_EXPLORERRESTARTED event that can be captured?
It is indeed the fault of the systray app itself if it does not reappear!  It's just too easy to blame Windows, people don't realize that it's the badly coded 3rd party apps that make their windows crash!
Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...
Maurits wrote:
How do you figure?  Is there a WM_EXPLORERRESTARTED event that can be captured?

Yes there is:
The Platform SDK wrote:
Taskbar Creation Notification

With Internet Explorer 4.0 and later, the Shell notifies applications that the taskbar has been created. When the taskbar is created, it registers a message with the TaskbarCreated string and then broadcasts this message to all top-level windows. When your taskbar application receives this message, it should assume that any taskbar icons it added have been removed and add them again. This feature generally applies only to services that are already running when the Shell begins execution. The following example shows a very simplified method for handling this case.

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, 
                         LPARAM lParam)
{
    static UINT s_uTaskbarRestart;

    switch(uMessage)
    {
        case WM_CREATE:
            s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
            break;
        
        default:
            if(uMessage == s_uTaskbarRestart)
                AddTaskbarIcons();
            break;
    }

    return DefWindowProc(hWnd, uMessage, wParam, lParam);
}
Maurits
Maurits
AKA Matthew van Eerde
Good to know... thanks, Sven!
It seems the NotifyIcon .NET class handles these messages automatically
Infragistics article (unreadably small font in Firefox, OK in IE)
dotnetjunkie wrote:
It is indeed the fault of the systray app itself if it does not reappear!  It's just too easy to blame Windows, people don't realize that it's the badly coded 3rd party apps that make their windows crash!


Whose fault is it? Windows Task Manager doesn't show up after explorer crashes?
msemack
msemack
Embedded Systems Guy
rbmjw wrote:

Whose fault is it? Windows Task Manager doesn't show up after explorer crashes?


It is the fault of the application which creates the systray icon, not Windows Explorer.

When Explorer restarts, it notifys the applications (as Sven Groot noted).  Any running application should respond to this notification by re-creating it's systray icons.

A lot of developers don't know to do this, or are too lazy to care.

If Windows Task Manager icon disappears after Explorer.Exe crashes, then there is a bug in the Task Manager.  You should report it to Microsoft.
Maurits
Maurits
AKA Matthew van Eerde
GRiNSER wrote:
Actually, the event notification about the recreation of the taskbar-explorer seems to be a silly workaround to not have to seperate the two processes...


I have to say I agree.  And I'm not just saying that to cover up my ignorance of the TaskbarCreated message. Wink

EDIT: Well, I don't entirely agree.  I could see how it would be useful to allow services (which start up before interactive login) to be able to display systray icons automatically.
msemack
msemack
Embedded Systems Guy
The event notification is not simply a work around for Explorer.exe crashing.  The taskbar can be recreated for other reasons.  Any app that doesn't respond to this message properly is broken, period.

Why aren't there 2 processes?  Because processes are expensive, expecially in the early days of Windows.

The simple answer is that Explorer was first designed for systems with 4-8 MB, and having separate processes for everything would be expensive, especially since they are closely related componenets.

As for why it is still that way, probably compatibility.  I bet splitting them up would break some applications.

Besides, what does this really gain?  Some miswritten apps won't vaish some the system tray?  That's about it.

This seems like a lot of work with very little benefit.
W3bbo
W3bbo
The Master of Baiters
GRiNSER wrote:
In my opinion it doesn't make any sence that the taskbar is integrated in the explorer process since the taskbar and the explorer windows have nothing in common


Actually... the Explorer file manager and the Taskbar make up the majority windows shell and they share many controls and window handles. They have more in common than you think.

But I do agree with moving them to separate processes.
msemack wrote:


Why aren't there 2 processes?  Because processes are expensive, expecially in the early days of Windows.


Processes are STILL expensive.  Every process that gets launched eats up a megabyte or so of memory (almost all of which is pagable) to hold its virtual address space

That's why things like the silly little "check to see if there's an update available for my program" applets bug me so much - I like the fact that they exist (that's good).

But I HATE the fact that they take up a process just to check every week or so for an update.

This kind of periodic task is exactly why WMI Jobs were created, it's quite frustrating when people don't take advantage of the feature.
ScanIAm
ScanIAm
On a scale of 1 to 10, people are stupid.
It could be that it just wasn't obvious that WMI Jobs was the way to do it.  I've been working on an app in my spare time, and I have yet to 'finish' it because I keep finding better and better ways to accomplish the same task. 

On the plus side, there are plenty of people to tell you how to do these various tasks and I'm lucky, I get to go to an INETA meeting tomorrow night and listen to Joe Healy.
redia
redia
Redia
i don't know whether there is any relationship with what you said, but it does encounter the "fatal error" with explorer.exe now and then, even when I'm refreshing my desktop pics...

And just be the same, everthing on my desktop go away fleetly and emerge again in a short while without some of the systray symbols   
msemack
msemack
Embedded Systems Guy
If you're having problems with Explorer.exe crashing, the solution is to fix the crashing.  Splitting it into multiple processes won't fix the crashing.

The way I see it, there are three possible causes:

- You have some kind of Explorer shell extension installed that is breaking explorer.  Do you have anything custom in your right-click menus?

- You've found a bug in Explorer.exe.

- You have flaky memory, and it's manifesting itself as a crash.  Do you have any other crashes?

Also, what is the exact message you get when Explorer.exe crashes?  This can be useful information for resolving the problem.
ZippyV
ZippyV
Fired Up
My Explorer.exe crashes frequently when I'm using the Windows Media Player and minimize it to the taskbar with the special wmp bar coming up.
LarryOsterman wrote:
This kind of periodic task is exactly why WMI Jobs were created, it's quite frustrating when people don't take advantage of the feature.

Cool!  Is there a .NET class to schedule tasks?  Or do you have an example in VB.NET or C# of how to use this please?
page 1 of 1
Comments: 21 | Views: 33590
Microsoft Communities