home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxwps.zip / crtwinen.cmd < prev    next >
OS/2 REXX Batch file  |  1995-09-01  |  3KB  |  65 lines

  1. /*
  2. program: CrtWinEn.CMD
  3. type:    REXXSAA-OS/2, OS/2 3.x
  4. purpose: create enhanced windows session
  5. version: 1.0
  6. date:    1995-09-01
  7. author:  Rony G. Flatscher (Rony.Flatscher@wu-wien.ac.at)
  8. usage:   CRTWINENH [win-exe-file [parameters]]
  9.          --- creates an enhanced, seemless, common WinOS2-session; starts given
  10.              Windows program and supplies given parameters (e.g. a filename); if
  11.              additional Windows programs are started, the existing WinOS2 
  12.              session will be used
  13.          --- if no Windows program is given, it defaults to program.exe
  14.  
  15. All rights reserved, copyrighted 1995, no guarantee that it works without
  16. errors, etc. etc.
  17.  
  18. donated to the public domain granted that you are not charging anything (money
  19. etc.) for it and derivates based upon it, as you did not write it,
  20. etc. if that holds you may bundle it with commercial programs too
  21.  
  22. you may freely distribute this program, granted that no changes are made
  23. to it; see also the '95 REXX Report from Miller & Freeman for REXX & WPS
  24. */
  25.  
  26. PARSE ARG exename param                         /* get arguments              */
  27.  
  28. progtype = "PROGTYPE=PROG_31_ENHSEAMLESSCOMMON;"
  29. title    = "WinOS2 enhanced"
  30. IF exename = "" THEN exename = "EXENAME=PROGMAN.EXE;"
  31.                 ELSE
  32.                 DO
  33.                    title = title "(" || exename || ")"
  34.                    exename = "EXENAME=" || exename || ";"
  35.                 END
  36.  
  37. IF param = "" THEN parameters = ""
  38.               ELSE parameters = "PARAMETERS=" || STRIP(param) || ";"
  39.  
  40. objectid = "<RGF_WinEnhCommon>"
  41.  
  42. setup    = progtype || exename     || parameters || ,
  43.            "SET WIN_ATM=1;"        ||,  /* make sure ATM is on                */
  44.            "SET WIN_CLIPBOARD=1;"  ||,  /* allow clipboard exchange with OS/2 */
  45.            "SET DPMI_MEMORY_LIMIT=128;" ||,/* make sure, enough memory defined*/
  46.            "OPEN=DEFAULT;"         ||,
  47.            "OBJECTID=" || objectid || ";"
  48.  
  49. location = "<WP_NOWHERE>"                       /* the "NOWHERE"-location     */
  50.  
  51. /* create object, if it exists already, replace it, finally open it           */
  52. ok = SysCreateObject("WPProgram", title, location, setup, "R") 
  53. SAY "creating -" ok(ok)
  54.  
  55. /* make sure, it is in the foreground                                         */
  56. ok = SysSetObjectData(objectid, "Open=Default;")
  57. SAY "setting  -" ok(ok)
  58.  
  59. EXIT
  60.  
  61. OK: PROCEDURE
  62.    IF ARG(1) THEN RETURN "successful."
  63.              ELSE RETURN "NOT succesful !"
  64.  
  65.