anchor.diff:  
   import 'package:win32/win32.dart';
   
  -class CustomTitleBarHoveredButton {
  +class HoveredButton {
     static const none = 0;
     static const minimize = 1;
     static const maximize = 2;
     static const close = 3;
   }
   
  +/// Scales a length or width for the given DPI ratio.
  +int dpiScale(int value, int dpi) => value * dpi ~/ 96;
  +
  +/// Given a Win32 RECT, duplicates it and returns the duplicate.
   Pointer<RECT> cloneRect(Pointer<RECT> rect) {
     final clone = calloc<RECT>()
       ..ref.bottom = rect.ref.bottom
  
positive.code:       final cursorPoint = calloc<POINT>()
          ..ref.x = LOWORD(lParam)
          ..ref.y = HIWORD(lParam);
        final titlebarRect = calloc<RECT>();
  
        try {
          ScreenToClient(hwnd, cursorPoint);
  
negative.code:   return minimizeRect;
  }
  
  /// Returns a handle for the theme. The handle should be closed when it is no
  /// longer needed.
  int getWindowThemeHandle(int hwnd) {
    final classDataSection = 'WINDOW'.toNativeUtf16();
    final hTheme = OpenThemeData(hwnd, classDataSection);
    free(classDataSection);
    return hTheme;
  }
  
  /// Returns a rect representing the non-client titlebar area.
  Pointer<RECT> getTitlebarRect(int hwnd) {
    const topAndBottomBorders = 2;
  
    final rect = calloc<RECT>();
    final titleBarSize = calloc<SIZE>();
  
    try {
      final hTheme = getWindowThemeHandle(hwnd);
      final dpi = GetDpiForWindow(hwnd);
      GetThemePartSize(hTheme, NULL, WINDOWPARTS.WP_CAPTION,
          CAPTIONSTATES.CS_ACTIVE, nullptr, THEMESIZE.TS_TRUE, titleBarSize);
      CloseThemeData(hTheme);
  
      final height = dpiScale(titleBarSize.ref.cy, dpi) + topAndBottomBorders;
  
      GetClientRect(hwnd, rect);
      rect.ref.bottom = rect.ref.top + height;
  
      return rect;
    } finally {
      free(titleBarSize);
    }
  }
  
  /// Returns a shadow representing the client area of the screen, including space
  /// for a fake shadow.
  Pointer<RECT> getFakeShadowRect(int hwnd) {
    final rect = calloc<RECT>();
    GetClientRect(hwnd, rect);
    rect.ref.bottom = rect.ref.top + 1;
    return rect;
  }
  
  /// Returns true if the window is maximized within the Windows definition.
  bool isWindowMaximized(int hwnd) {
    final windowPlacement = calloc<WINDOWPLACEMENT>()
      ..ref.length = sizeOf<WINDOWPLACEMENT>();
  