! Copyright (C) 2017-2018 Alexander Ilin.
-! See http://factorcode.org/license.txt for BSD license.
+! See https://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.data alien.libraries alien.strings
-continuations fry io.encodings.utf16n kernel literals math
-namespaces sequences ui.backend.windows ui.gadgets.worlds
-ui.gestures windows.messages windows.shell32 windows.types
-windows.user32 ;
+init io.encodings.utf16 kernel literals math namespaces
+sequences ui.backend.windows ui.gadgets.worlds
+ui.gestures windows.errors windows.messages windows.shell32
+windows.types windows.user32 ;
IN: windows.dropfiles
: filecount-from-hdrop ( hdrop -- n )
] with map ;
! : point-from-hdrop ( hdrop -- loc )
-! POINT <struct> [ DragQueryPoint drop ] keep [ x>> ] [ y>> ] bi 2array ;
+! POINT new [ DragQueryPoint drop ] keep [ x>> ] [ y>> ] bi 2array ;
: handle-wm-dropfiles ( hdrop -- )
<alien> [ filenames-from-hdrop dropped-files set-global ] [ DragFinish ] bi
TRUE DragAcceptFiles init-message-filter install-wm-handler ;
: hwnd-reject-files ( hwnd -- )
- f DragAcceptFiles ;
+ FALSE DragAcceptFiles ;
: world-accept-files ( world -- )
handle>> hWnd>> hwnd-accept-files ;
: world-reject-files ( world -- )
- handle>> hWnd>> hwnd-accept-files ;
+ handle>> hWnd>> hwnd-reject-files ;
: accept-files ( -- )
world get world-accept-files ;
: reject-files ( -- )
world get world-reject-files ;
+
+STARTUP-HOOK: [ f \ init-message-filter set-global ]