\ File: ShellExecute.f \ Author: Dirk Busch \ Created: January 25th, 2004 - 17:22 - dbu \ Updated: Mittwoch, März 16 2005 - 17:56 - dbu \ \ ShellExecute() support for Win32Forth cr .( Loading ShellExecute support) anew ShellExecute.f INTERNAL [UNDEFINED] ("ShellExecute) [IF] : ("ShellExecute) { operation addr cnt hWnd -- errorcode } \ open file using default application SW_SHOWNORMAL \ nShowCmd Null \ default directory Null \ parameters addr cnt asciiz rel>abs \ file name to execute operation rel>abs \ operation to perform hWnd \ parent Call ShellExecute ; [THEN] : ShellExecuteErr ( errorcode -- ) dup 32 <= \ error? if ." Failed to execute file! (Error: " base @ >r dup . GetLastWinErrMsg count type r> base ! ." )" abort else drop then ; EXTERNAL : "ShellEdit { addr cnt hWnd \ temp$ -- } \ edit file using default application z" edit" addr cnt hWnd ("ShellExecute) ShellExecuteErr ; : "ShellExplore { addr cnt hWnd \ temp$ -- } \ Explores the folder z" explore" addr cnt "path-only" hWnd ("ShellExecute) ShellExecuteErr ; : "ShellFind { addr cnt hWnd \ temp$ -- } \ Initiates a search starting from the specified directory z" find" addr cnt "path-only" hWnd ("ShellExecute) ShellExecuteErr ; : "ShellOpen { addr cnt hWnd \ temp$ -- } \ open file using default application z" open" addr cnt hWnd ("ShellExecute) ShellExecuteErr ; : "ShellPrint { addr cnt hWnd \ temp$ -- } \ print file using default application z" print" addr cnt hWnd ("ShellExecute) ShellExecuteErr ; : "ShellProperties { addr cnt hWnd \ temp$ -- } \ print file using default application z" properties" addr cnt hWnd ("ShellExecute) ShellExecuteErr ; : ShellEdit ( -- ) /parse-s$ count conhndl "ShellEdit ; : ShellExplore ( -- ) /parse-s$ count conhndl "ShellExplore ; : ShellFind ( -- ) /parse-s$ count conhndl "ShellFind ; : ShellOpen ( -- ) /parse-s$ count conhndl "ShellOpen ; : ShellPrint ( -- ) /parse-s$ count conhndl "ShellPrint ; : ShellProperties ( -- ) /parse-s$ count conhndl "ShellProperties ; MODULE