         [ drop SW_RESTORE ShowWindow win32-error=0/f ]
     } 2cleave ;
 
-M: windows-ui-backend (set-fullscreen) ( ? world -- )
+M: windows-ui-backend (set-fullscreen)
     [ enter-fullscreen ] [ exit-fullscreen ] if ;
 
-M: windows-ui-backend (fullscreen?) ( world -- ? )
+M: windows-ui-backend (fullscreen?)
     handle>> hWnd>>
     [ hwnd>RECT ] [ fullscreen-RECT ] bi
     [ get-RECT-dimensions 2array 2nip ] same? ;
 
-M: windows-ui-backend resize-window ( world dim -- )
-  [ handle>> hWnd>> dup hwnd>RECT get-RECT-top-left ]
-  [ first2 FALSE ] bi* MoveWindow win32-error=0/f ;
+M:: windows-ui-backend resize-window ( world dim -- )
+    world handle>> hWnd>>
+    world window-loc>> dim <RECT> dup
+    world world>style
+    world world>ex-style
+    adjust-RECT get-RECT-dimensions FALSE
+    MoveWindow win32-error=0/f ;
 
 M: windows-ui-backend ui-backend-available?
     t ;

: hwnd>RECT ( hwnd -- RECT )
    RECT <struct> [ GetWindowRect win32-error=0/f ] keep ;

M: windows-ui-backend (grab-input) ( handle -- )
    0 ShowCursor drop
    hWnd>> client-area>RECT ClipCursor drop ;

M: windows-ui-backend (ungrab-input) ( handle -- )
    drop
    f ClipCursor drop
    1 ShowCursor drop ;

    [ dup handle>> hWnd>> register-window ]
    [ handle>> hWnd>> show-window ] tri ;

M: win-base select-gl-context
    [ hDC>> ] [ hRC>> ] bi wglMakeCurrent win32-error=0/f
    GdiFlush drop ;

M: win-base flush-gl-context
    hDC>> SwapBuffers win32-error=0/f ;

! Windows 32-bit bitmaps don't actually use the alpha byte of
