Module: win32-duim Synopsis: Win32 back-end utilities Author: David Gray, Scott McKay, Andy Armstrong Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: Functional Objects Library Public License Version 1.0 Dual-license: GNU Lesser General Public License Warranty: Distributed WITHOUT WARRANTY OF ANY KIND /// Simple definitions for freeing things with a COM IMalloc interface. define C-subtype ( ) end; define C-pointer-type => ; define C-function IMalloc/Free input parameter This :: ; input parameter pv :: ; c-name: "C_IMalloc_Free"; end; /// Definitions for access to some Win32 Shell API functionality ///--- Maybe put in some win32-XXX library if we ever use more related stuff. define constant = ; define constant $NOERROR :: = as(,0); define constant = ; define constant $BIF-RETURNONLYFSDIRS = #x0001; define constant $BFFM-INITIALIZED = 1; define constant $BFFM-SETSELECTIONA = ($WM-USER + 102); define constant $BFFM-SETSELECTION = $BFFM-SETSELECTIONA; define constant = ; define macro -callback-wrapper { -callback-wrapper(?new:name,?old:name) } => { -callback-wrapper(?new,?old) } end macro -callback-wrapper; define C-struct // mkid slot cb-value :: ; // size of identifier, including cb itself array slot abID-array :: , length: 1, address-getter: abID-value; pointer-type-name: ; c-name: "struct _SHITEMID"; end C-struct ; define constant = ; ignore(cb-value, cb-value-setter, abID-array, abID-array-setter, abID-value, ); define C-struct // idl slot mkid-value :: ; // list of item identifers pointer-type-name: ; c-name: "struct _ITEMIDLIST"; end C-struct ; define constant = ; ignore(mkid-value, mkid-value-setter, ); define C-struct slot hwndOwner-value :: ; slot pidlRoot-value :: ; slot pszDisplayName-value :: ; slot lpszTitle-value :: ; slot ulFlags-value :: ; slot lpfn-value :: ; slot lParam-value :: ; slot iImage2-value :: ; // slot iImage-value :: ; // this name is sealed in win32-controls pointer-type-name: ; c-name: "struct _browseinfoA"; end C-struct ; define constant = ; define constant = ; ignore(hwndOwner-value, hwndOwner-value-setter, pidlRoot-value, pidlRoot-value-setter, pszDisplayName-value, pszDisplayName-value-setter, lpszTitle-value, lpszTitle-value-setter, ulFlags-value, ulFlags-value-setter, lpfn-value, lpfn-value-setter, lParam-value, lParam-value-setter, iImage2-value, iImage2-value-setter); define C-function SHBrowseForFolder parameter lpbi :: ; result value :: ; c-name: "SHBrowseForFolderA", c-modifiers: "__stdcall"; end; define C-function SHGetPathFromIDList parameter pidl :: ; parameter pszPath :: ; result value :: ; c-name: "SHGetPathFromIDListA", c-modifiers: "__stdcall"; end; define C-function SHGetMalloc output parameter ppmalloc :: ; result value :: ; c-name: "SHGetMalloc", c-modifiers: "__stdcall"; end; /// Timer proc define macro -callback-wrapper { -callback-wrapper(?new:name,?old:name) } => { define C-callable-wrapper ?new of ?old parameter hWnd :: ; parameter uMsg :: ; parameter idEvent :: ; parameter dwTime :: ; c-modifiers: "__stdcall"; end C-callable-wrapper } end;