Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: newbieQ: How to launch an external application from Rebol ?

From: greggirwin:starband at: 28-Sep-2001 17:07

<< Am I the only person who would like to use Rebol to launch Win32 apps cleanly ? >> Surely not. I think the question is, can RT give us what we want while maintaining portability? In any case, try the attached code and see if it works for you. I didn't take time to define enums or anything but I'd be interested to hear if it eliminates your problem. --Gregg REBOL [] win-user: load/library %shell32.dll win-shell: context [ execute: make routine! [ hwndParent [integer!] Operation [string!] File [string!] Parameters [string!] Directory [string!] ShowCmd [integer!] return: [integer] ] win-user "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