title: How to detect that Taskbar Thumbnail Preview is being drawn when DWMWA_HAS_ICONIC_BITMAP is set
body: <p>How to detect that Taskbar Thumbnail Preview is being drawn (because user is moving mouse over taskbar button) or is currently appearing on screen?</p>
  <p>Why the code below does not make log entries when WM_DWMSENDICONICTHUMBNAIL msg should be arriving to form?</p>
  <pre><code>    procedure TStartInfoForm.FormCreate(Sender: TObject);
      begin        
        SetWindowAttribute(DWMWA_HAS_ICONIC_BITMAP);               
      end;
      function TStartInfoForm.SetWindowAttribute(dwAttr: DWORD): HRESULT;
      var
        Attr: function(hwnd: hwnd; dwAttribute: DWORD; pvAttribute: Pointer;
         cbAttribute: DWORD): HRESULT; stdcall;
       hndDLLHandle : THandle;
       EnableAttribute : DWORD;
      begin
        EnableAttribute := DWORD(true);
        try
          hndDLLHandle := loadLibrary('dwmapi.dll');
          if hndDLLHandle &lt;&gt; 0 then
          begin
            Attr := getProcAddress(hndDLLHandle, 'DwmSetWindowAttribute');
            if addr(Attr) &lt;&gt; nil then
             Result := Attr(Handle, dwAttr, @EnableAttribute, SizeOf(EnableAttribute));
          end;
        finally
          freeLibrary(hndDLLHandle);
        end;
      end;
  
  procedure TStartInfoForm.WndProc(var Msg : TMessage);
  begin    
   DebugNote(0,'wndproc '+inttohex(msg.Msg,3)+' w '+inttohex(Msg.wparam,3)+' l '+inttohex(Msg.lparam,3));
      
     case Msg.Msg of    
      WM_DWMSENDICONICTHUMBNAIL : 
     begin
      DebugNote(0,' iconiclive');
     end;
      WM_DWMSENDICONICLIVEPREVIEWBITMAP:
     begin
      DebugNote(0,' iconiclive2 ');    
     end;
  
        WM_WINDOWPOSCHANGING:
        begin
  //   MessageBeep(1);
        end                ;
        WM_WINDOWPOSCHANGED:
        begin
  //   MessageBeep(1);
        end
     end;
     inherited;// call this for default behaveour
   end;
  </code></pre>