Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

My applicatioin is not being notified of "TaskbarCreated" messages!

Hi all,

My applicatioon install a systray icon using the ShellNotify API. The problem is that when Explorer crashes, my icon dissapears from the task bar.

I found in the net that for solving this I need to register the message "TaskbarCreated" and redraw the icon whenever I receive this message. Here is the code:

'The for is subclassed:

Public Function MyWndProc(ByVal hwnd As Long, ByVal message As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim sResult As Long
sResult = CallWindowProc(mvarSubC.OldFunc, hwnd, message, wParam, lParam)
Select Case message
Case WM_CREATE
WM_TASKBARCREATED = RegisterWindowMessage("TaskbarCreated")
Case WM_TASKBARCREATED
AddIcon
End Select
' calls the default window procedure
MyWndProc = sResult
End Function

So I register the message when the windows is created, and then wait for the WM_TASKBARCREATED message for drawing the icon again.

However this is not working since my appliucation is not redrwaing the icon after an Explorer crash (I simulate this by killing the Explorer.exe process)

Has anyone been successful on catching the "TaskbarCreated" message? Is there any thing I am missing here?

Thanks...John
Sign In or Register to comment.