private static WinDef.HWND getHandle(@NotNull Window window) {
    try {
      ComponentPeer peer = AWTAccessor.getComponentAccessor().getPeer(window);
      Method getHWnd = peer.getClass().getMethod("getHWnd");
      return new WinDef.HWND(new Pointer((Long)getHWnd.invoke(peer)));
    }
    catch (Throwable e) {
      LOG.error(e);
      return null;
    }
  }
private static WinDef.HWND getHandle(@NotNull Window window)