MSDN上说是在IE4以后的系统中会有这个产生 - U* Z. e. G/ t
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. ' H2 r" R' s) [. q i
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, / \, Z1 M: L. h# [ `' O
LPARAM lParam)# u% p6 ^' ?) J
{
. ]1 z2 @: _2 R6 e; `) I" K static UINT s_uTaskbarRestart;
! j8 F! e+ X, F' N+ I5 a6 [: V/ R; A- M1 f: R& L7 d, A/ m {
switch(uMessage)
6 N, V; [* X4 ?* t {
: O ?1 O- `! K) y3 s: [ case WM_CREATE:$ \5 g4 w1 G6 Z1 P
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
% I0 f; h4 z# c7 \" q6 o- W break;' j" @4 y/ g4 n4 H
, q1 r; y; c |( A4 ]2 Z/ q default:. j2 i2 ]4 F9 l! B: T3 i
if(uMessage == s_uTaskbarRestart)
% E4 ]& A n; n T& C AddTaskbarIcons();$ F- n& C) C0 d
break;
3 o( v& i8 k7 {) w P }
' h% S- F1 \6 V: ?+ G# H1 X
5 ^% D2 x3 M K. x" m( B return DefWindowProc(hWnd, uMessage, wParam, lParam);
; h+ Y- w0 F! [+ N8 k}* S' b, g: F7 J/ Q# [9 a
[此贴子已经被作者于2004-12-13 23:50:57编辑过]
6 V s- E& O6 R) ~. ]0 T |