[REBOL] Re: newbieQ: How to launch an external application from Rebol ?
From: greggirwin::starband::net at: 28-Sep-2001 20:26
Hi Jason,
<< YES!! Thank you very much for this.. >>
Glad it worked!
<< btw, do you know what the miminum Rebol will work for is -> View Pro ? >>
I belive so.
Here is a cleaned up version. I patched it together quickly and it had
some warts. This one puts the library word inside the context and gives
it a better name. (I couldn't remember if ShellExecute was in User or
Shell and I forgot to change the word)
--Gregg
REBOL []
win-shell: context [
win-lib: load/library %shell32.dll
execute: make routine! [
hwndParent [integer!]
Operation [string!]
File [string!]
Parameters [string!]
Directory [string!]
ShowCmd [integer!]
return: [integer!]
] win-lib "ShellExecuteA"
; Operation values
; "open"
; "print"
; "explore"
; ShowCmd values
; 0 Hides the window and passes activation to another window.
;
; 1 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 9).
;
; 2 Activates a window and displays it as an icon.
;
; 3 Activates a window and displays it as a maximized window.
;
; 4 Displays a window in its most recent size and position. The
; window that is currently active remains active.
;
; 5 Activates a window and displays it in its current size and
; position.
;
; 6 Minimizes the specified window and activates the top-level
; window in the system's list.
;
; 7 Displays a window as an icon. The window that is currently
; active remains active.
;
; 8 Displays a window in its current state. The window that is
; currently active remains active.
;
; 9 Activates and displays a window. If the window is minimized
; or maximized, Windows restores it to its original size and
; position (same as 1).
]
win-shell/execute 0 "open" "notepad.exe" "" "" 1
win-shell/execute 0 "open" "calc.exe" "" "" 1