update windows.* for <c-array> change
parent
c1fe3854d4
commit
5925043d34
|
@ -1,16 +1,19 @@
|
||||||
USING: windows.com windows.com.wrapper combinators
|
USING: alien.strings io.encodings.utf16n windows.com
|
||||||
windows.kernel32 windows.ole32 windows.shell32 kernel accessors
|
windows.com.wrapper combinators windows.kernel32 windows.ole32
|
||||||
|
windows.shell32 kernel accessors
|
||||||
prettyprint namespaces ui.tools.listener ui.tools.workspace
|
prettyprint namespaces ui.tools.listener ui.tools.workspace
|
||||||
alien.c-types alien sequences math ;
|
alien.c-types alien sequences math ;
|
||||||
IN: windows.dragdrop-listener
|
IN: windows.dragdrop-listener
|
||||||
|
|
||||||
|
<< "WCHAR" require-c-arrays >>
|
||||||
|
|
||||||
: filenames-from-hdrop ( hdrop -- filenames )
|
: filenames-from-hdrop ( hdrop -- filenames )
|
||||||
dup HEX: FFFFFFFF f 0 DragQueryFile ! get count of files
|
dup HEX: FFFFFFFF f 0 DragQueryFile ! get count of files
|
||||||
[
|
[
|
||||||
2dup f 0 DragQueryFile 1 + ! get size of filename buffer
|
2dup f 0 DragQueryFile 1 + ! get size of filename buffer
|
||||||
dup "WCHAR" <c-array>
|
dup "WCHAR" <c-array>
|
||||||
[ swap DragQueryFile drop ] keep
|
[ swap DragQueryFile drop ] keep
|
||||||
alien>u16-string
|
utf16n alien>string
|
||||||
] with map ;
|
] with map ;
|
||||||
|
|
||||||
: filenames-from-data-object ( data-object -- filenames )
|
: filenames-from-data-object ( data-object -- filenames )
|
||||||
|
|
|
@ -4,6 +4,8 @@ io.encodings.string io.encodings.utf16n alien.strings
|
||||||
arrays literals ;
|
arrays literals ;
|
||||||
IN: windows.errors
|
IN: windows.errors
|
||||||
|
|
||||||
|
<< "TCHAR" require-c-arrays >>
|
||||||
|
|
||||||
CONSTANT: ERROR_SUCCESS 0
|
CONSTANT: ERROR_SUCCESS 0
|
||||||
CONSTANT: ERROR_INVALID_FUNCTION 1
|
CONSTANT: ERROR_INVALID_FUNCTION 1
|
||||||
CONSTANT: ERROR_FILE_NOT_FOUND 2
|
CONSTANT: ERROR_FILE_NOT_FOUND 2
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
! Copyright (C) 2006, 2008 Doug Coleman.
|
! Copyright (C) 2006, 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien alien.c-types alien.strings alien.syntax
|
USING: alien alien.c-types alien.strings alien.syntax
|
||||||
combinators io.encodings.utf16n io.files io.pathnames kernel
|
classes.struct combinators io.encodings.utf16n io.files
|
||||||
windows.errors windows.com windows.com.syntax windows.user32
|
io.pathnames kernel windows.errors windows.com
|
||||||
windows.ole32 windows ;
|
windows.com.syntax windows.user32 windows.ole32 windows
|
||||||
|
specialized-arrays.ushort ;
|
||||||
IN: windows.shell32
|
IN: windows.shell32
|
||||||
|
|
||||||
CONSTANT: CSIDL_DESKTOP HEX: 00
|
CONSTANT: CSIDL_DESKTOP HEX: 00
|
||||||
|
@ -90,7 +91,7 @@ ALIAS: ShellExecute ShellExecuteW
|
||||||
|
|
||||||
: shell32-directory ( n -- str )
|
: shell32-directory ( n -- str )
|
||||||
f swap f SHGFP_TYPE_DEFAULT
|
f swap f SHGFP_TYPE_DEFAULT
|
||||||
MAX_UNICODE_PATH "ushort" <c-array>
|
MAX_UNICODE_PATH <ushort-array>
|
||||||
[ SHGetFolderPath drop ] keep utf16n alien>string ;
|
[ SHGetFolderPath drop ] keep utf16n alien>string ;
|
||||||
|
|
||||||
: desktop ( -- str )
|
: desktop ( -- str )
|
||||||
|
@ -194,10 +195,13 @@ CONSTANT: STRRET_WSTR 0
|
||||||
CONSTANT: STRRET_OFFSET 1
|
CONSTANT: STRRET_OFFSET 1
|
||||||
CONSTANT: STRRET_CSTR 2
|
CONSTANT: STRRET_CSTR 2
|
||||||
|
|
||||||
C-UNION: STRRET-union "LPWSTR" "LPSTR" "UINT" "char[260]" ;
|
UNION-STRUCT: STRRET-union
|
||||||
C-STRUCT: STRRET
|
{ pOleStr LPWSTR }
|
||||||
{ "int" "uType" }
|
{ uOffset UINT }
|
||||||
{ "STRRET-union" "union" } ;
|
{ cStr char[260] } ;
|
||||||
|
STRUCT: STRRET
|
||||||
|
{ uType int }
|
||||||
|
{ value STRRET-union } ;
|
||||||
|
|
||||||
COM-INTERFACE: IEnumIDList IUnknown {000214F2-0000-0000-C000-000000000046}
|
COM-INTERFACE: IEnumIDList IUnknown {000214F2-0000-0000-C000-000000000046}
|
||||||
HRESULT Next ( ULONG celt, LPITEMIDLIST* rgelt, ULONG* pceltFetched )
|
HRESULT Next ( ULONG celt, LPITEMIDLIST* rgelt, ULONG* pceltFetched )
|
||||||
|
|
Loading…
Reference in New Issue