anchor.diff:      WM_NCACTIVATE:
           begin
             {$IFDEF DEBUG}
  -            writeln(w.ClassName + ': WM_NCACTIVATE');
  +            write(w.ClassName + ': WM_NCACTIVATE ');
  +            writeln(wParam);
             {$ENDIF}
  -          if (Lo(wParam) = WA_INACTIVE) then
  +          if (wParam = 0) then
               fpgSendMessage(nil, w, FPGM_DEACTIVATE)
             else
               fpgSendMessage(nil, w, FPGM_ACTIVATE);
  
positive.code:     Windows.RegisterClass(@HiddenWndClass);
  
      FHiddenWindow := CreateWindow('FPGHIDDEN', '',
        DWORD(WS_POPUP), 0, 0, 0, 0, 0, 0, MainInstance, nil);
    end;
    Result := FHiddenWindow;
  end;
  
negative.code:   end;
    dx := (2 * bx);
    dy := (2 * by) + bt;
  end;
  
  function fpgCBTProc(nCode: longint; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  begin
    if nCode < 0 then
    begin
      Result := CallNextHookEx(wapplication.ActivationHook, nCode, wParam, lParam);
      Exit; //==>
    end;
  
    if (nCode = HCBT_ACTIVATE) then
    begin
      // write('Hooked HCBT_ACTIVATE at '+IntToStr(wParam)+': ');
      if (wapplication.TopModalForm <> nil) and
         (wParam <> TfpgWindowImpl(wapplication.TopModalForm).FWinHandle) then
      begin
        // writeln('stopped');
        SetActiveWindow(TfpgWindowImpl(wapplication.TopModalForm).FWinHandle);
        Result := 1;
      end else
      begin
        // writeln('passed');
        Result := 0;
      end;
    end else
      Result := CallNextHookEx(wapplication.ActivationHook, nCode, wParam, lParam);
  end;
  
  function fpgWindowProc(hwnd: HWND; uMsg: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;
  