Thread: Bug report
View Single Post
Old 2002-10-12, 00:19   #1
remaker
 
Oct 2002

23 Posts
Default Bug report

When EXPLORER restarts due to a crash, the Prime 95 icon is lost

This is a trivial(ish) fix. Can Prime 95 get the fix? At least for shell 4.7 and later.

(When will Prime 95 become Prime 2000? or Prime XP? Or Prime .NET ? 8-) )

From a google search on the topic:

When the shell version is 4.7 or later, an explorer crash results in a
message being broadcast. The message is
RegisterWindowMessage('TaskbarCreated'). Look for it in your app's
DefaultHandler() method; if you receive it, restore your tray icon.

If you must also recover from an explorer crash in older Windows versions (basically Win95 or NT4 without the Windows Desktop Update), it gets more complicated. What I do is get the tray's window handle with
FindWindowEx(GetDesktopWindow, 0, 'Shell_TrayWnd', nil), then get its
process ID, and open a process handle on that process. I wait on that
handle in a thread, and if it is signaled (meaning the process died), I
wait for the tray to re-appear, restore the icon, and re-start the
WaitFor in the thread. Find an example in the source for one of my tray-
based PC Magazine utilities, umm... Reloader or AutoAct will do. Find
them at www.pcmag.com/utilities.
remaker is offline   Reply With Quote