home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / MDSK14.ZIP / CrtObj.txt next >
Text File  |  1993-02-10  |  47KB  |  1,166 lines

  1. Subject: REXXUTIL Information and Samples
  2.  
  3. The following attempts to better explain some of the powerful features
  4. provided by OS/2 V2's dynamic link library; REXXUTIL.DLL (Rexx utility
  5. functions). REXXUTIL functions are described in the online 'REXX Information'
  6. reference and the 'OS/2 2.0 Technical Library Procedures Language/2 REXX
  7. Reference' publication (order number S10G-6268). The information following is
  8. intended to provide a more detailed description of some of the functions.
  9.  
  10. One should realize that many of the functions provided by REXXUTIL have
  11. origins with Presentation Manager WinXXX calls. The 'OS/2 Technical
  12. Library Presentation Manager Programming Reference Vol2' publication
  13. (order number S10G-6265) can be reviewed for more information.
  14.  
  15. Some of the functions used/explained:
  16.  
  17. SysIni:
  18. Using REXXUTIL's SysIni function one can modify many settings of the WorkPlace
  19. Shell as well as change other applications settings that make use of *.INI
  20. files such as the system OS2.INI and OS2SYS.INI.
  21.  
  22. SysCreateObject: (PM WinCreateObject - Create Workplace Object)
  23. Using REXXUTIL's SysCreateObject function one can create various objects;
  24. like folders, programs, and shadow objects using Rexx. This section for the
  25. most part includes parameter information which was gathered together from
  26. various sources of information.
  27.  
  28. SysSetObjectData: (PM WinSetObjectData - Set Object Data)
  29. Using REXXUTIL's SysSetObjectData function one can change an objects
  30. characteristics (of an already created object, if you know its objectid).
  31.  
  32. SysDestroyObject: (PM WinDestroyObject - Destroy Workplace Object)
  33. Using REXXUTIL's SysDestroyObject one can delete an object created if you
  34. know its objectid.
  35.  
  36. Misc Notes:
  37. If one views the *.RC files located in your bootdrive:\OS2 directory you
  38. can learn a lot about the various INI settings and folder structure.
  39. Review INI.RC and INISYS.RC files, they are used to create your OS2.INI
  40. and OS2SYS.INI files.
  41.  
  42. Some of REXXUTIL's functions are only available when using the very latest
  43. REXX20 PACKAGE which consists of the very latest REXX fixes and enhancements
  44. for OS/2 V2. So should you have problems running any of the sample programs
  45. you should make sure your system has the vary latest REXX20 updates.
  46.  
  47. Change Log:
  48.   04/30/92 - Added information about DuplicateFlag parm
  49.            - Added more setup string information from manuals
  50.   06/02/92 - Added information about breaking Title line character "^"
  51.            - Added information about adding multiple DOS_DEVICE statements
  52.            - Added code to SHADOW.CMD to make shadow object of a file
  53.   !!NOTE!! - The REXXOS2 fixes are required to make some of
  54.              the newer samples work properly.
  55.   06/30/92 - Added information regarding two new REXXUTIL functions:
  56.              SysSetObjectData and SysDestroyObject, also two new
  57.              samples STARTDOS, BOOTDOS (Thanks to Rick McGuire)
  58.   07/13/92 - Reorganized the way the material is presented. Also added more
  59.              sample Rexx routines REBUILD, OBJCLASS and LPTADD, descriptions
  60.              follow. Also changed parm CONCURRENTVIEW to CCVIEW (Thanks
  61.              Dan Kehn, Felix Sawicki)
  62.   07/15/92 - Updated entire document as I mistakenly truncated it at 80
  63.              characters. Rewrote some sample Rexx routines so they do not
  64.              extend beyond 80 characters. Also updated the SysSetObjectData
  65.              description to show how can open an object (Thanks Rick). Added
  66.              information about creating multi-line titles, carat works for
  67.              two line titles but not more than 2.
  68.              New samples, OBJECTID and FONTS included, descriptions follow.
  69.   07/29/92 - Corrected an error I made when I broke the setup lines into
  70.              multiple lines. I needed to add ||'s to make sure they
  71.              concatenated without spaces (Thanks Rick). Also added
  72.              information regarding changing some System Settings (added
  73.              new section after sample Rexx code). Also added warning
  74.              in REBUILD.CMD sample about replacing Folder objects. Also
  75.              added new sample ICONRES.CMD which builds a folder containing
  76.              many of the OS/2 V2 installed icons using system DLL files.
  77.  
  78. This append consists of multiple pieces of information:
  79.  
  80. 1) Large block of text containing information that pertains to the subject.
  81.    (TEXT INFORMATION)
  82. 2) Sample Rexx code, some complete programs, others code fragments:
  83.  - (FOLDER.CMD)
  84.    Creates a folder and program objects in the folder
  85.  - (SHADOW.CMD)
  86.    Creates shadows of objects
  87.  - (FLDSHAD.CMD)
  88.    Creates a folder, then program object in the folder, then place a shadow
  89.    of the program object on the desktop.
  90.  - (STARTDOS.CMD)
  91.    Starts a DOS program using specific DOS VDM settings.
  92.  - (BOOTDOS.CMD)
  93.    Starts a DOS session, booting from a specific DOS image with
  94.    specific DOS VDM settings.
  95.  - (REBUILD.CMD)
  96.    Allows one to rebuild OS/2 system objects, like MAKEINI does.
  97.  - (LPTADD.CMD)
  98.    Code using SysIni to add LPT4-9 ports.
  99.  - (OBJECTID.CMD)
  100.    Code using SysIni to list OBJECTIDs known to the WorkPlace Shell
  101.  - (FONTS.CMD)
  102.    Code using SysIni to list installed fonts.
  103.  - ICONRES.CMD
  104.    Code building a folder containing many of the various icons found in
  105.    installed DLL files for OS/2 V2. Demonstrates use of setup string
  106.    parameter ICONRESOURCE.
  107. 3) Code Fragments
  108.  - (SYSSET)
  109.    Shows using SysIni to toggle various System Settings
  110.  
  111. ((BEGIN TEXT INFORMATION))
  112. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  113.  
  114. -- Help information regarding the SysCreateObject function of REXXUTIL --
  115.  
  116. Function: SysCreateObject
  117. Syntax:
  118. result=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)
  119.  
  120.  classname:The name of the object class.
  121.  
  122.  title:    The object title.
  123.  
  124.  location: The object location.  This can be specified as either a
  125.            descriptive path (for example, OS/2 System Folder\System
  126.            Configuration) or a file system path (for example,
  127.            C:\bin\mytools).
  128.  
  129.  setup:    A WinCreateObject setup string.
  130.  
  131.  duplicateflag: This parameter indicates what action should be taken
  132.            when the Setup string specifies an object ID, and an object with
  133.            that object ID already exists. If the setup string does not give
  134.            an object ID, a duplicate object will be created.
  135.  
  136.  result    The return code from WinCreateObject. This returns 1 (TRUE) if the
  137.            object was created and 0 (FALSE) if the object was not created.
  138.  
  139.  Purpose:  Create a new instance of an object class.
  140.  
  141. -- Help information regarding the SysSetObjectData function of REXXUTIL --
  142.  
  143. Function: SysSetObjectData
  144. Syntax:
  145. result=SysSetObjectData(name, setup)
  146.  
  147.  name:     The object name.  This can be specified as an object id (for
  148.            example <WP_DESKTOP>) or as a fully specified file name.
  149.  
  150.  setup:    A WinCreateObject setup string.
  151.  
  152.  Purpose:  Alter the settings of an existing object. Can also be used to
  153.            open an instance of an object:
  154.                                  /* open up the system folder */
  155.            call SysSetObjectData '<WP_OS2SYS>', 'OPEN=DEFAULT;'
  156.  
  157. See the description of the SysCreateObject location and setup strings
  158. following for an explanation of the parameters.
  159.  
  160. -- Help information regarding the SysDestroyObject function of REXXUTIL --
  161.  
  162. Function: SysDestroyObject
  163. Syntax:
  164. result=SysDestroyObject(name)
  165.  
  166.  name:     The object name.  This can be specified as an object id (for
  167.            example <WP_DESKTOP>) or as a fully specified file name.
  168.  
  169.  Purpose:  Destroys an existing object.
  170.  
  171. See the description of the SysCreateObject location parameter
  172. following for an explanation of the object name.
  173.  
  174. --SysCreateObject Parms------------------------------------------------------
  175.  
  176. The SysCreateObject parameters are now explained in more detail.
  177.  
  178. Remember syntax is...
  179. result=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)
  180.  
  181. classname:
  182.   A registered object class defined to the system. Of particular interest are
  183.   the WPFolder/WPProgram/WPShadow classes. Note using the sample Rexx code
  184.   included in the SysQueryClassList function help screen one can list all
  185.   of the registered classes:
  186.  
  187.   call SysQueryClassList "list."
  188.   do i = 1 to list.0
  189.      say 'Class' i 'is' list.i
  190.   end
  191.  
  192. title:
  193.   Easy one, the objects title you want to use. If you wish to break the title
  194.   line use the carat "^" symbol in the title. Ex. 'First line^Second Line'
  195.   This works to break a title into two lines. However to break a title into
  196.   more than two lines you need to separate the title lines with a hex 0A
  197.   (line-feed) character.
  198.   Rexx example:
  199.   h0A='0A'X
  200.   title='First'h0A'Second'h0A'Third'
  201.  
  202. location:
  203.   The objects location can be specified as either a descriptive path (for
  204.   example, OS/2 System Folder\System Configuration) or a file system path
  205.   (for example, C:\bin\mytools). However by looking at the INI.RC file one
  206.   can see a use of other "locations", such as <WP_DESKTOP>. If this is used
  207.   as a location then your object will reside on the WorkPlace Shell desktop.
  208.   If you are creating a folder or program object you should make sure you use
  209.   the setup string option and give that folder a unique OBJECTID. We'll see
  210.   how this works later.
  211.  
  212.   HINTS: Here are some predefined object ids of system folders. Also if you
  213.          are thinking of placing an object in the Startup Folder <WP_START>,
  214.          make it a shadow of an object.
  215.          <WP_DESKTOP>   The Desktop.
  216.          <WP_START>     The Startup folder.
  217.          <WP_OS2SYS>    The System folder.
  218.          <WP_TEMPS>     The Templates folder.
  219.          <WP_CONFIG>    The System Setup folder.
  220.          <WP_INFO>      The Information folder.
  221.          <WP_DRIVES>    The Drives folder.
  222.          <WP_NOWHERE>   The hidden folder.
  223.  
  224. setup:
  225.   This field needs the most explaining, a larger section following details
  226.   many of the available setupstring parameters. The setupstring field contains
  227.   a series of "keyname=value" pairs separated by semi-colons that change the
  228.   behavior of an object. Each object class documents its keynames and the
  229.   parameters it expects to see.
  230.  
  231. duplicateflag:
  232.   There are three possible values for this parameter:
  233.   FailIfExists - No object should be created if an object with the
  234.       given object already exists. This is the default and maps to the
  235.       PM creation flag, CO_FAILIFEXISTS
  236.   ReplaceIfExists - If an object with the given object ID already exists,
  237.       the existing object should be replaced. Maps to the PM creation
  238.       flag, CO_REPLACEIFEXISTS.
  239.   UpdateIfExists - If an object with the given object ID already exists,
  240.       the existing object should be updated with the new information.
  241.       Maps to the creation flag, CO_UPDATEIFEXISTS.
  242.   (Only the first character is required/examined, i.e. F, R, or U)
  243.  
  244. ALL parameters have safe defaults, so it is never necessary to pass
  245. unnecessary parameters to an object.
  246.  
  247. --Setup Strings--------------------------------------------------------------
  248.  
  249.   What follows are both WPFolder and WPProgram setup string parameters.
  250.   Their various key names, values and a short description follow
  251.   each item. The <<xxx>> item is there to give you an idea of what
  252.   Workplace Shell settings "page" you would find this information on.
  253.  
  254. *********************************
  255. ***WPFolder setup string parms***
  256. *********************************
  257. KEYNAME      VALUE           Description
  258. -----------------------------------------------------------------------------
  259. <<View>>
  260. OPEN         ICON            Open icon view when object is created.
  261.              TREE            Open tree view when object is created.
  262.              DETAILS         Open details view when object is created.
  263. ICONVIEW     s1[,s2,...sn]   Set icon view to specified style(s).
  264. TREEVIEW     s1[,s2,...sn]   Set tree view to specified style(s).
  265. DETAILSVIEW  s1[,s2,...sn]   Set details view to specified style(s).
  266. (styles)     FLOWED          flowed list items
  267.              NONFLOWED       non-flowed list items
  268.              NONGRID         non-gridded icon view
  269.              NORMAL          normal size icons
  270.              MINI            small icons
  271.              INVISIBLE       no icons
  272.              LINES           lines in tree view
  273.              NOLINES         no lines in tree view
  274. <<Background>>
  275. BACKGROUND   filename        Sets the folder background. filename is the
  276.                              name of a file in the \OS2\BITMAP directory
  277.                              of the boot drive.
  278. <<File>>
  279. WORKAREA     YES             Make the folder a Workarea folder
  280. <<Window>>
  281. MINWIN       HIDE            Views of this object will hide when their
  282.                              minimize button is selected.
  283.              VIEWER          Views of this object will minimize to the
  284.                              minimized window viewer when their minimize
  285.                              button is selected.
  286.              DESKTOP         Views of this object will minimize to the
  287.                              Desktop when their minimize button is selected.
  288. VIEWBUTTON   HIDE            Views of this object will have a hide button
  289.                              as opposed to a minimize button.
  290.              MINIMIZE        Views of this object will have a minimize button
  291.                              as opposed to a hide button.
  292. CCVIEW       YES             New views of this object will be created every
  293.                              time the user selects open.
  294.              NO              Open views of this object will resurface when
  295.                              the user selects open.
  296. <<General>>
  297. ICONFILE     filename        This sets the object's icon.
  298. ICONRESOURCE id,module       This sets the object's icon. 'id' is the
  299.                              identity of an icon resource in the 'module'
  300.                              dynamic link library (DLL).
  301. ICONPOS      x,y             This sets the object's initial icon position.
  302.                              The x and y values represent the position in
  303.                              the object's folder in percentage coordinates.
  304. TEMPLATE     YES             Creates object as a template.
  305.              NO              Resets objects template property.
  306. -----------------------------------------------------------------------------
  307.  
  308. **********************************
  309. ***WPProgram setup string parms***
  310. **********************************
  311. KEYNAME      VALUE           Description
  312. -----------------------------------------------------------------------------
  313. <<Program>>
  314. EXENAME      filename        Sets the name of the program
  315. PARAMETERS   params          Sets the parameters list, which may
  316.                              include substitution characters
  317. STARTUPDIR   pathname        Sets the working directory
  318. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  319. <<Sessions>>
  320. PROGTYPE     FULLSCREEN      Sets the session type to OS/2 full screen
  321.              PM              Sets the session type to PM
  322.              SEPARATEWIN     Sets the session type to WIN-OS2 window
  323.                              running in a separate VDM.
  324.              VDM             Sets the session type to DOS full screen
  325.              WIN             Sets the session type to WIN-OS2 full screen
  326.              WINDOWABLEVIO   Sets the session type to OS/2 windowed
  327.              WINDOWEDVDM     Sets the session type to DOS windowed
  328.              WINDOWEDWIN     Sets the session type to WIN-OS2 windowed
  329. MINIMIZED    YES             Start program minimized
  330. MAXIMIZED    YES             Start program maximized
  331. NOAUTOCLOSE  YES             Leaves the window open upon program termination.
  332.              NO              Closes the window when the program terminates.
  333. -DOS Settings-
  334. NOTES:
  335. - To change these values you use SET keyname=
  336.   Example:   SET DOS_FILES=45;SET DOS_HIGH=1
  337.   Also for some use values of 1 for ON, 0 for off
  338.   Example:   SET COM_HOLD=1;     (on, default is off)
  339.   To add more than one DOS_DEVICE you need to separate with hex 0A (line-feed)
  340.   Rexx example:
  341.   h0A='0A'X
  342.   setup='...;SET DOS_DEVICE=C:\OS2\MDOS\ANSI.SYS'h0A'C:\OS2\MDOS\EGA.SYS...'
  343.  
  344. List of DOS Setting fields
  345. COM_HOLD
  346. DOS_BACKGROUND_EXECUTION
  347. DOS_BREAK
  348. DOS_DEVICE
  349. DOS_FCBS
  350. DOS_FCBS_KEEP
  351. DOS_FILES
  352. DOS_HIGH
  353. DOS_LASTDRIVE
  354. DOS_RMSIZE
  355. DOS_SHELL
  356. DOS_STARTUP_DRIVE
  357. DOS_UMB
  358. DOS_VERSION
  359. DPMI_DOS_API
  360. DPMI_MEMORY_LIMIT
  361. DPMI_NETWORK_BUFF_SIZE
  362. DPMI_DOS_API
  363. EMS_FRAME_LOCATION
  364. EMS_HIGH_OS_MAP_REGION
  365. EMS_LOW_OS_MAP_REGION
  366. EMS_MEMORY_LIMIT
  367. HW_NOSOUND
  368. HW_ROM_TO_RAM
  369. HW_TIMER
  370. IDLE_SECONDS
  371. IDLE_SENSITIVITY
  372. KBD_ALTHOME_BYPASS
  373. KBD_BUFFER_EXTEND
  374. KBD_RATE_LOCK
  375. MEM_INCLUDE_REGIONS
  376. MEM_EXCLUDE_REGIONS
  377. MOUSE_EXCLUSIVE_ACCESS
  378. PRINT_TIMEOUT
  379. VIDEO_FASTPASTE
  380. VIDEO_MODE_RESTRICTION
  381. VIDEO_ONDEMAND_MEMORY
  382. VIDEO_RETRACE_EMULATION
  383. VIDEO_ROM_EMULATION
  384. VIDEO_SWITCH_NOTIFICATION
  385. VIDEO_WINDOW_REFRESH
  386. VIDEO_8514A_XGA_IOTRAP
  387. XMS_HANDLES
  388. XMS_MEMORY_LIMIT
  389. XMS_MINIMUM_HMA
  390. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  391. <<Association>>
  392. ASSOCFILTER  filters         Sets the filename filter for files
  393.                              associated to this program.
  394.                              Multiple filters are separated by commas.
  395. ASSOCTYPE    type            Sets the type of files associated to this
  396.                              program. Multiple filters are separated
  397.                              by commas.
  398. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  399. <<Window>>
  400. MINWIN       HIDE            Views of this object will hide when their
  401.                              minimize button is selected.
  402.              VIEWER          Views of this object will minimize to the
  403.                              minimized window viewer when their minimize
  404.                              button is selected.
  405.              DESKTOP         Views of this object will minimize to the
  406.                              Desktop when their minimize button is selected.
  407. VIEWBUTTON   HIDE            Views of this object will have a hide button
  408.                              as opposed to a minimize button.
  409.              MINIMIZE        Views of this object will have a minimize button
  410.                              as opposed to a hide button.
  411. CCVIEW       YES             New views of this object will be created every
  412.                              time the user selects open.
  413.              NO              Open views of this object will resurface when
  414.                              the user selects open.
  415. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  416. <<General>>
  417. ICONFILE     filename        This sets the object's icon.
  418. ICONRESOURCE id,module       This sets the object's icon. 'id' is the
  419.                              identity of an icon resource in the 'module'
  420.                              dynamic link library (DLL).
  421. ICONPOS      x,y             This sets the object's initial icon position.
  422.                              The x and y values represent the position in
  423.                              the object's folder in percentage coordinates.
  424. TEMPLATE     YES             Creates object as a template.
  425.              NO              Resets objects template property.
  426. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  427. <<Misc>>
  428. OBJECTID     <name>          This sets the object's identity. The object
  429.                              id will stay with the object even if it is
  430.                              moved or renamed. An object id is any unique
  431.                              string preceded with a '<' and terminated
  432.                              with a '>'. This may also be a real name
  433.                              specified as a fully qualified path name.
  434. HELPPANEL    id              This sets the object's default help panel.
  435. HELPLIBRARY  filename        This sets the help library.
  436. OPEN         SETTINGS        Open settings view when object is created.
  437.              DEFAULT         Open default view when object is created.
  438. NODELETE     YES             Will not allow you to delete the object.
  439. NOCOPY       YES             Will not allow you to make a copy.
  440. NOMOVE       YES             Will not allow you to move the object to another
  441.                              folder, will create shadow on a move.
  442. NODRAG       YES             Will not allow you to drag the object.
  443. NOLINK       YES             Will not allow you to create a shadow link.
  444. NOSHADOW     YES             Will not allow you to create a shadow link.
  445. NORENAME     YES             Will not allow you to rename the object.
  446. NOPRINT      YES             Will not allow you to print it.
  447. NOTVISIBLE   YES             Will not display the object.
  448. -----------------------------------------------------------------------------
  449.  
  450. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  451. ((END TEXT INFORMATION))
  452.  
  453. ((BEGIN REXX CMD SAMPLES))
  454.  
  455. - (FOLDER.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  456.  
  457. /* FOLDER.CMD: Sample code using REXXUTIL's SysCreateObject function    */
  458. /* Builds a folder on the DeskTop and places some program objects in it.*/
  459. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  460. /* Load REXXUTIL */
  461. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  462. call sysloadfuncs
  463.  
  464. /*The basic call is listed next.                                           */
  465. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/
  466.  
  467. call SysCls
  468. Say '';Say 'Using REXXUTILs to Add a Folder and Program Objects...'
  469.  
  470. Say '';Say 'Press Y to add Test Folder to Desktop...';Say '';
  471. parse upper value SysGetKey('NOECHO') with key
  472. If key<>'Y' Then Exit
  473.  
  474. /* All of the routines pass parameters to a subroutine to perform the call */
  475. classname='WPFolder'
  476. title='Test Folder'
  477. location='<WP_DESKTOP>'
  478. setup='OBJECTID=<TEST_FOLDER>'
  479. Call BldObj
  480.  
  481. Say '';Say 'Now go and open up the folder, currently no items are there.'
  482. Say 'Press ENTER and we will add a few program objects...'
  483. key=SysGetKey()
  484.  
  485. Say 'Place a program object into the folder...';Say '';
  486. classname='WPProgram'
  487. title='SYSLEVEL-FULLSCR'
  488. location='<TEST_FOLDER>'
  489. setup='OBJECTID=<TEST_SYSL>;'||,
  490.       'EXENAME=\OS2\SYSLEVEL.EXE;'||,
  491.       'PROGTYPE=FULLSCREEN;'
  492. Call BldObj
  493.  
  494. classname='WPProgram'
  495. title='CHKDSK-PM'
  496. location='<TEST_FOLDER>'
  497. setup='OBJECTID=<TEST_PMCK>;'||,
  498.       'EXENAME=\OS2\PMCHKDSK.EXE;'||,
  499.       'MINIMIZED=YES;'||,
  500.       'PROGTYPE=PM;'
  501. Call BldObj
  502.  
  503. classname='WPProgram'
  504. title='SYSLEVEL-VIO'
  505. location='<TEST_FOLDER>'
  506. setup='OBJECTID=<TEST_SYSLVIO>;'||,
  507.       'EXENAME=\OS2\SYSLEVEL.EXE;'||,
  508.       'PROGTYPE=WINDOWABLEVIO;'
  509. Call BldObj
  510.  
  511. classname='WPProgram'
  512. title='MEM-Fullscreen'
  513. location='<TEST_FOLDER>'
  514. setup='OBJECTID=<TEST_MEMFUL>;'||,
  515.       'EXENAME=\OS2\MDOS\MEM.EXE;'||,
  516.       'PROGTYPE=VDM;'||,
  517.       'PARAMETERS=/?;'||,
  518.       'NOAUTOCLOSE=YES;'
  519. Call BldObj
  520.  
  521. classname='WPProgram'
  522. title='MEM-WindowVDM'
  523. location='<TEST_FOLDER>'
  524. setup='OBJECTID=<TEST_MEMWIN>;'||,
  525.       'EXENAME=\OS2\MDOS\MEM.EXE;'||,
  526.       'PROGTYPE=WINDOWEDVDM;'||,
  527.       'PARAMETERS=/?;'||,
  528.       'NOAUTOCLOSE=YES;'
  529. Call BldObj
  530. Say '';Say 'All done, to remove objects drag to shredder...'
  531.  
  532. Exit
  533.  
  534. /* Build Object */
  535. BldObj:
  536. call charout ,'Building: 'title
  537.  
  538. /* Build object using REPLACE as duplicateflag */
  539. result = SysCreateObject(classname, title, location, setup, 'R')
  540.  
  541. If result=1 Then call charout ,'...   Object created!'
  542. Else             call charout ,'...   Not created! Return code='result
  543.  
  544. Say '';
  545. Return
  546.  
  547. - (SHADOW.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  548.  
  549. /* SHADOW.CMD: Sample code using REXXUTIL's SysCreateObject function    */
  550. /* Builds shadows on the DeskTop and Startup Folder                     */
  551. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  552. /* Load REXXUTIL */
  553. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  554. call sysloadfuncs
  555.  
  556. Call SysCls
  557. Say '';Say 'Using REXXUTILs to Add Shadow Objects...'
  558.  
  559. /* The titles and objectid's are found from the \OS2\INI.RC file */
  560.  
  561. Say '';Say 'First lets place some items on the Desktop...'
  562. title='Enhanced Editor'; objid='<WP_EPM>'   ; loc='<WP_DESKTOP>'; call AddShad
  563. title='OS/2 Window'    ; objid='<WP_OS2WIN>'; loc='<WP_DESKTOP>'; call AddShad
  564. title='System Clock'   ; objid='<WP_CLOCK>' ; loc='<WP_DESKTOP>'; call AddShad
  565.  
  566. Say '';Say 'You can even make shadow objects of files...'
  567. title='CONFIG.SYS'; objid='C:\CONFIG.SYS' ; loc='<WP_DESKTOP>'; call AddShad
  568.  
  569. Say '';Say 'Now lets place an item in the Startup Folder...'
  570. title='System Clock'   ; objid='<WP_CLOCK>' ; loc='<WP_START>'  ; call AddShad
  571.  
  572. Say '';Say 'All done, to remove objects drag to shredder...'
  573.  
  574. Exit
  575.  
  576. AddShad:
  577. Say '';Say 'Press Y to add shadow object: 'title' to 'loc
  578. parse upper value SysGetKey('NOECHO') with key
  579. If key='Y' Then Do
  580.  
  581.    /* Build object using FAIL as duplicateflag */
  582.    result=SysCreateObject('WPShadow', title, loc, 'SHADOWID='objid, 'F')
  583.  
  584.    If result=1 Then Say 'Object created'
  585.    Else             Say 'Not created, return code='result
  586. End
  587. Return
  588.  
  589. - (FLDSHAD.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  590.  
  591. /* FLDSHAD.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  592. /* Builds a folder on the DeskTop places a program object in it then    */
  593. /* places a shadow of the program object on the DeskTop.                */
  594. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  595. /* Load REXXUTIL */
  596. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  597. call sysloadfuncs
  598.  
  599. /*The basic call is listed next.                                           */
  600. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/
  601.  
  602. call SysCls
  603. Say '';Say 'Using REXXUTILs to Add Folder/Program/Shadow Objects...'
  604.  
  605. Say '';Say 'Press Y to add Test Folder to Desktop...';Say '';
  606. parse upper value SysGetKey('NOECHO') with key
  607. If key<>'Y' Then Exit
  608.  
  609. classname='WPFolder'
  610. title='Test Folder'
  611. location='<WP_DESKTOP>'
  612. setup='OBJECTID=<TEST2_FOLDER>'
  613. Call BldObj
  614.  
  615. Say '';Say 'Press Y to place a program object into the folder...';Say '';
  616. parse upper value SysGetKey('NOECHO') with key
  617. If key<>'Y' Then Exit
  618.  
  619. classname='WPProgram'
  620. title='SYSLEVEL-VIO'
  621. location='<TEST2_FOLDER>'
  622. setup='OBJECTID=<TEST2_SYSLVIO>;'||,
  623.       'EXENAME=\OS2\SYSLEVEL.EXE;'||,
  624.       'PROGTYPE=WINDOWABLEVIO;'
  625. Call BldObj
  626.  
  627. Say '';
  628. Say 'Press Y to place a shadow of the program object on the Desktop...';
  629. Say '';
  630. parse upper value SysGetKey('NOECHO') with key
  631. If key<>'Y' Then Exit
  632.  
  633. classname='WPShadow'
  634. title='SYSLEVEL-VIO'
  635. location='<WP_DESKTOP>'
  636. setup='SHADOWID=<TEST2_SYSLVIO>'
  637. Call BldObj
  638.  
  639. Say '';Say 'All done, to remove objects drag to shredder...'
  640.  
  641. Exit
  642.  
  643. /* Build Object */
  644. BldObj:
  645. call charout ,'Building: 'title
  646.  
  647. /* Build object using REPLACE as duplicateflag */
  648. result = SysCreateObject(classname, title, location, setup, 'R')
  649.  
  650. If result=1 Then call charout ,'...   Object created!'
  651. Else             call charout ,'...   Not created! Return code='result
  652.  
  653. Say '';
  654. Return
  655.  
  656. - (STARTDOS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  657.  
  658. /* STARTDOS.CMD: Sample code using REXXUTIL's SysCreateObject function  */
  659. /* Starts a DOS program using specific DOS VDM settings.  This is       */
  660. /* particularly useful for LAN execution that requires NET USE commands.*/
  661. /* The example invokes the PKZIP.EXE program using files setting of 45  */
  662. /* Rick McGuire:  MCGUIRE/GDLVM7                                        */
  663. /* Load REXXUTIL */
  664. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  665. call sysloadfuncs
  666.  
  667. /* The basic call is listed next.                                          */
  668. /* result = SysCreateObject(classname, title, location, setup)             */
  669.  
  670. classname='WPProgram'
  671. title='My DOS Program'
  672. location='<WP_NOWHERE>'                  /* place in invisible folder      */
  673. program='EXENAME=C:\PKZIP.EXE;'          /* DOS program name               */
  674. type='PROGTYPE=WINDOWEDVDM;'             /* type of DOS session (windowed) */
  675. startup='STARTUPDIR=C:\;'                /* startup directory              */
  676. settings='SET DOS_FILES=45;'             /* required DOS settings          */
  677. open='OPEN=DEFAULT;'                     /* open now                       */
  678.  
  679. call SysCreateObject classname, title, location,,
  680.     program||type||startup||settings||open, 'REPLACE'
  681. Return
  682.  
  683. - (BOOTDOS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  684.  
  685. /* BOOTDOS.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  686. /* Starts a DOS session, booting from a specific DOS image with         */
  687. /* specific DOS VDM settings.                                           */
  688. /* Rick McGuire:  MCGUIRE/GDLVM7                                        */
  689. /* Load REXXUTIL */
  690. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  691. call sysloadfuncs
  692.  
  693. /* The basic call is listed next.                                          */
  694. /* result = SysCreateObject(classname, title, location, setup)             */
  695.  
  696. classname='WPProgram'
  697. title='Booted DR DOS'
  698. location='<WP_NOWHERE>'                  /* place in invisible folder      */
  699. program='EXENAME=*;'                     /* DOS program name (use shell)   */
  700. type='PROGTYPE=WINDOWEDVDM;'             /* type of DOS session (windowed) */
  701. image='C:\DRDOS.VM;'                     /* DOS image file                 */
  702.                                          /* required DOS settings          */
  703. settings='SET DOS_BACKGROUND_EXECUTION=ON;'
  704. open='OPEN=DEFAULT;'                     /* open now                       */
  705.  
  706. call SysCreateObject classname, title, location,,
  707.     program||type||image||settings||open, 'REPLACE'
  708. Return
  709.  
  710. - (REBUILD.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  711.  
  712. /* REBUILD.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  713. /* Can be used to rebuild objects created during the installation of    */
  714. /* your OS/2 system. The \OS2\INSTALL\INI.RC file contains information  */
  715. /* that can be used by the SysCreateObject function.                    */
  716. /* The INI.RC file is used by MAKEINI.EXE to create your OS2.INI file   */
  717. /* Syntax:  Enter  "REBUILD ?" for complete syntax                      */
  718. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  719. '@ECHO OFF'
  720. /* Load REXXUTIL */
  721. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  722. call sysloadfuncs
  723.  
  724. Arg parms
  725. cmdparms=parms /* Save command line parms for later processing */
  726.  
  727. /* Until REXXUTIL offers a function call to retrieve the OS2 boot drive   */
  728. /* we assume the environment variable COMSPEC has location of boot drive. */
  729. BtDrv=filespec('drive',value('COMSPEC',,'OS2ENVIRONMENT'))
  730.  
  731. parse upper var cmdparms type '(' inifile .
  732. /* If user does not enter location of *.RC file then try to find it */
  733. If inifile='' Then inifile=BtDrv||'\OS2\INI.RC'
  734. rcx=stream(inifile,'C','Q EXISTS')
  735. If rcx='' Then Do
  736.    Say '';Say '';Say inifile 'not found'
  737.    Return
  738. End
  739. type=left(type,1)
  740. If verify(type,'FPOA') Then Signal Helper
  741.  
  742. /* Initialize tables and table counters */
  743. iniftab.=''; iniptab.='' iniotab.=''; /*Folders, Programs, Others */
  744. iniflns=0;   iniplns=0;  iniolns=0;
  745. initab.='';  inilns=0;
  746. Call stream inifile,'C','CLOSE'
  747. Do while lines(inifile)>0  /* Read RC file into tables */
  748.    lne=linein(inifile)
  749.    parse var lne '"PM_InstallObject"' lne
  750.    If lne\='' Then Do
  751.       parse var lne '"'rest1'" 'lne
  752.       parse var lne '"'setup'"'
  753.       parse var rest1 title';'object';'location
  754.       If object='WPFolder' Then Do
  755.          iniflns=iniflns+1
  756.          iniftab.1.iniflns=object;   iniftab.2.iniflns=title;
  757.          iniftab.3.iniflns=location; iniftab.4.iniflns=setup;
  758.       End
  759.       Else If object='WPProgram' Then Do
  760.          iniplns=iniplns+1
  761.          iniptab.1.iniplns=object;   iniptab.2.iniplns=title;
  762.          iniptab.3.iniplns=location; iniptab.4.iniplns=setup;
  763.       End
  764.       Else Do
  765.          iniolns=iniolns+1
  766.          iniotab.1.iniolns=object;   iniotab.2.iniolns=title;
  767.          iniotab.3.iniolns=location; iniotab.4.iniolns=setup;
  768.       End
  769.    End
  770. End
  771. Call stream inifile,'C','CLOSE'
  772.  
  773. /* Calculation for screen loop */
  774. parse value SysTextScreenSize() with row col
  775. scrsz=row-12
  776.  
  777. If type='F' | type='A' Then Do; /* Folder routine */
  778.    objt='Folder'; inilns=iniflns;
  779.    Do i=1 to inilns; Do j=1 to 4;
  780.       initab.j.i=iniftab.j.i
  781.    End; End;
  782.    Call DispSel
  783. End;
  784. If type='P' | type='A' Then Do; /* Program routine */
  785.    objt='Program'; inilns=iniplns;
  786.    Do i=1 to inilns; Do j=1 to 4;
  787.       initab.j.i=iniptab.j.i
  788.    End; End;
  789.    Call DispSel
  790. End;
  791. If type='O' | type='A' Then Do; /* Other routine */
  792.    objt='Other'; inilns=iniolns;
  793.    Do i=1 to inilns; Do j=1 to 4;
  794.       initab.j.i=iniotab.j.i
  795.    End; End;
  796.    Call DispSel
  797. End;
  798. Return; /* When get here done with processing */
  799.  
  800. /* Routine to display objects and allow selection */
  801. DispSel:
  802. key=''
  803. Do while key\='Q'
  804.    Call SysCls; Say '';Say objt' objects found in: 'inifile;Say '';
  805.    Do i=1 to inilns
  806.       If trunc(i/scrsz)==i/scrsz Then Call Promptx 1
  807.       If key='Q' Then leave
  808.       n=right('  '||i,3)||') '||left(initab.2.i||copies(' ',30),30)
  809.       n=n||left(initab.3.i||copies(' ',20),20)
  810.       Say n
  811.    End
  812.    If key\='Q' Then Call Promptx 0
  813. End
  814. Return
  815.  
  816. /* Screen loop routine also calls object build routine */
  817. Promptx: Arg scr
  818. Say '';Say 'To attempt to rebuild an object enter the number of the object'
  819. If scr=0 Then Say 'or enter Q to quit...'
  820. Else Say 'or press enter to show next screen...  Or enter Q to Quit...'
  821. pull key .
  822. If (key>=1) & (key <=inilns) then,
  823.     rcx=BldIt(initab.1.key,initab.2.key,initab.3.key,initab.4.key)
  824. If scr=1 Then Do;
  825.    Call SysCls;Say '';Say objt' objects found in: 'inifile;Say '';
  826. End;
  827. Return
  828.  
  829. /* Routine to build object */
  830. BldIt: Parse Arg object,title,location,setup
  831. If object='WPFolder' Then Do
  832.    call SysCls
  833.    Say '';Say '';
  834.    Say 'WARNING: Any attempt to rebuild a folder object will first'
  835.    Say '         delete each and every object in that folder!!!!'
  836.    Say ''
  837.    Say 'If you really do want to rebuild: 'title
  838.    Say 'Press Y, any other key will not rebuild.'
  839.    parse upper value SysGetKey('NOECHO') with key
  840.    If key<>'Y' Then Return ''
  841. End
  842. Say 'SysCreateObject('object', 'title', 'location', 'setup', R)'
  843. /* Build object using REPLACE as duplicateflag */
  844. result = SysCreateObject(object, title, location, setup, 'R')
  845. If result=1 Then Say '...   Object created!'
  846. Else             Say '...   Not created! Return code='result
  847. Say '';Say 'Press ENTER to continue...'
  848. Pull ans
  849. Return result
  850.  
  851. /* Syntax help */
  852. Helper:
  853. call SysCls
  854. Say '';Say ''; Say 'REBUILD:'
  855. Say 'Routine to rebuild system installed objects listed in *.RC files.'
  856. Say 'Can be used as an alternative to using the MAKEINI command.'
  857. Say 'Your INI.RC file is used by MAKEINI.EXE during installation to'
  858. Say 'create your OS2.INI file.'
  859. Say '';
  860. Say 'Any attempt to rebuild an object first deletes any object that'
  861. Say 'is using that same <objectid>. This can be useful if you want to'
  862. Say 'restore an object back to its original installed state. This can'
  863. Say 'also be bad since if you rebuild a folder it first deletes all'
  864. Say 'objects in it since that is its initial install state.'
  865. Say ''; Say 'Syntax:';Say '';
  866. Say 'REBUILD object [(filespec]'
  867. Say '';Say 'Valid objects A(ll), F(olders), P(rograms), O(ther)'
  868. Say 'Can also can use (filespec for name of *.RC file, default is \OS2\INI.RC'
  869. Exit
  870.  
  871. - (LPTADD.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  872.  
  873. /* LPTADD.CMD: Sample code using REXXUTIL's SysIni function.            */
  874. /* Routine will expand the number of LPT ports the WorkPlace Shell      */
  875. /* recognizes from LPT1-3 to LPT1-9. Also a routine to add LPT3-9 to    */
  876. /* the WIN-OS2 WIN.INI file.                                            */
  877. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  878. '@ECHO OFF'
  879. /* Load REXXUTIL */
  880. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  881. call sysloadfuncs
  882.  
  883. /* The basic call for setting a single key value is listed next.        */
  884. /* result = SysIni([inifile], app, key, val)                            */
  885.  
  886. call SysCls; Say '';
  887. Say 'Using REXXUTILs SysIni call to add LPT4-9 to the WorkPlace Shell'
  888. Say '';Say 'Press Y to add/initialize LPT4-9 ports...';Say '';
  889. parse upper value SysGetKey('NOECHO') with key
  890. If key='Y' Then Do
  891.    Say 'LPT Ports: setting up for LPT4-9 ports...'
  892.    Do n=4 to 9
  893.       Say ' Setting up PM_LPT'n'...'
  894.       rx=SysIni('SYSTEM', 'PM_SPOOLER_PORT', 'LPT'n, ';'||'00'x)
  895.       If rx\='' Then Say 'LPT'n' Bad result='result
  896.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'DESCRIPTION', 'LPT'||n||'00'x)
  897.       If rx\='' Then Say 'LPT'n' Bad result='result
  898.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'INITIALIZATION', ';'||'00'x)
  899.       If rx\='' Then Say 'LPT'n' Bad result='result
  900.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'PORTDRIVER', 'PARALLEL;'||'00'x)
  901.       If rx\='' Then Say 'LPT'n' Bad result='result
  902.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'TERMINATION', ';'||'00'x)
  903.       If rx\='' Then Say 'LPT'n' Bad result='result
  904.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'TIMEOUT', '45;'||'00'x)
  905.       If rx\='' Then Say 'LPT'n' Bad result='result
  906.    End
  907.    Say 'LPT4-9 added... Press any key to continue...'
  908.    SysGetKey('NOECHO')
  909. End
  910.  
  911. call SysCls; Say '';
  912. Say 'Can now attempt to add LPT3-9 to your WIN-OS2 WIN.INI file.'
  913. Say '';Say 'Press Y to attempt to add LPT3-9 ports to WIN-OS2...';Say '';
  914. parse upper value SysGetKey('NOECHO') with key
  915. If key='Y' Then Do
  916.   /* Change \OS2\MDOS\WINOS2\WIN.INI to add more ports LPT3-LPT9 */
  917.   win.='';winnew.='';
  918.   /* Until REXXUTIL offers a function call to retrieve the OS2 boot drive  */
  919.   /* we assume the enviroment variable COMSPEC has location of boot drive. */
  920.   BtDrv=filespec('drive',value('COMSPEC',,'OS2ENVIRONMENT'))
  921.   fn=BtDrv'\OS2\MDOS\WINOS2\WIN.INI';
  922.   fnx=stream(fn,'C','QUERY EXISTS')
  923.   fn=fnx;
  924.   If fn\='' Then Do /* If file exists then process adding extra ports */
  925.      Call stream fn,'C','CLOSE'
  926.      Do i=1 to 10000 while LINES(fn)>0
  927.         parse value linein(fn) with win.i
  928.      End
  929.      Call stream fn,'C','CLOSE'
  930.      i=i-1; k=0;
  931.      Do j=1 to i /* Look for FILE:= then if line before = LPT2.OS2= add 3-9 */
  932.         If win.j='FILE:=' Then Do
  933.            m=j-1; winchg=no;
  934.            If win.m='LPT2.OS2=' Then Do
  935.               Say 'LPT Ports: setting up for Windows LPT3-9 ports...'
  936.               winchg=yes;
  937.               Do n=3 to 9
  938.                  Say ' Setting up: LPT'n'.OS2='
  939.                  k=k+1; winnew.k='LPT'n'.OS2='
  940.               End;
  941.            End;
  942.         End;
  943.         k=k+1;
  944.         winnew.k=win.j;
  945.      End;
  946.      If winchg=yes Then Do;
  947.         parse var fnx fnx'.' .
  948.         ifn=fnx||'.???';
  949.         ifn=SysTempFileName(ifn)
  950.         '@COPY' fn ifn '1>NUL 2>NUL' /* Copy original to backup name */
  951.         Say 'Copy of' fn 'saved as' ifn
  952.         Say 'Writing' fn 'with added lines.'
  953.         call lineout fn,,1 /* Start writing at first character */
  954.         Do i=1 to k /* write file back out */
  955.            call lineout fn,winnew.i
  956.         End
  957.         Call stream fn,'C','CLOSE'
  958.      End;
  959.      Else Say 'Lines not added, either already done or not what we expect.'
  960.   End;
  961.   Else Say 'Could not locate' fn 'program ending...'
  962. End;
  963. Say 'LPTADD ending...'
  964. Exit
  965.  
  966. - (OBJECTID.CMD) - - --  - - - - - - - - - - - - - - - - - - - - - - - - - -
  967.  
  968. /* OBJECTID.CMD: Sample code using REXXUTIL's SysIni function.          */
  969. /* Routine will display the OBJECTIDs known to the WorkPlace Shell      */
  970. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  971. '@ECHO OFF'
  972. /* Load REXXUTIL */
  973. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  974. call sysloadfuncs
  975.  
  976. /* List ObjectIds */
  977. App='PM_Workplace:Location'
  978. call SysIni 'USER', App, 'All:', 'Keys'
  979. if Result \= 'ERROR:' then do
  980.    Call SysCls
  981.    Say '';Say '';Say 'Listing ObjectId information';Say '';
  982.    parse value SysTextScreenSize() with row col
  983.    j=row-10
  984.    Do i=1 to Keys.0
  985.       If trunc(i/j)==i/j Then Do
  986.          Say '';Say 'Press any key to show next screen...'
  987.          key=SysGetKey()
  988.          Call SysCls
  989.          Say '';Say '';Say 'Listing ObjectId information';Say '';
  990.       End
  991.       Say Keys.i
  992.    End
  993. End
  994. Else Say 'Error querying for' App
  995. Return
  996.  
  997. - (FONTS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  998.  
  999. /* FONTS.CMD: Sample code using REXXUTIL's SysIni function.             */
  1000. /* Routine will display the FONTS known to the WorkPlace Shell          */
  1001. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  1002. '@ECHO OFF'
  1003. /* Load REXXUTIL */
  1004. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1005. call sysloadfuncs
  1006.  
  1007. /* List installed Fonts */
  1008. App='PM_Fonts'
  1009. call SysIni 'USER', App, 'All:', 'Keys'
  1010. If Result \= 'ERROR:' then do
  1011.    Do j=1 to Keys.0
  1012.       Keys.j=Keys.j 'Installed as:' SysIni('USER', App, Keys.j)
  1013.    End
  1014.    Call SysCls
  1015.    Say '';Say '';Say 'Listing Installed Fonts';Say '';
  1016.    parse value SysTextScreenSize() with row col
  1017.    j=row-10
  1018.    Do i=1 to Keys.0
  1019.       If trunc(i/j)==i/j Then Do
  1020.          Say '';Say 'Press any key to show next screen...'
  1021.          key=SysGetKey()
  1022.          Call SysCls
  1023.          Say '';Say '';Say 'Listing Installed Fonts';Say '';
  1024.       End
  1025.       Say Keys.i
  1026.    End
  1027. End
  1028. Else Say 'Error querying for' App
  1029. Return
  1030.  
  1031. - (ICONRES.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1032.  
  1033. /* ICONRES.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  1034. /* Routine will create a folder containing many icons available in      */
  1035. /* installed DLLs on an OS/2 V2 system. Shows how to use the setup      */
  1036. /* string parm: ICONRESOURCE                                            */
  1037. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  1038. '@ECHO OFF'
  1039. /* Load REXXUTIL */
  1040. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1041. call sysloadfuncs
  1042.  
  1043. call SysCls
  1044. Say '';
  1045. Say 'Using REXXUTILs to demonstrate use of the ICONRESOURCE parameter.'
  1046. Say 'A folder will be created and populated with various icons found'
  1047. Say 'in some installed DLL files.'
  1048. Say '';
  1049. Say 'ICONRESOURCE is a SysCreateObject setup string parameter, has syntax:'
  1050. Say '';
  1051. Say '  ICONRESOURCE=id module       Ex:  ICONRESOURCE=3 PMWP;'
  1052. Say '  id=number of the icon resource, module=filename of the DLL'
  1053. Say ''; Say 'NOTE: Over 70 icons, program will run for a minute or two.'
  1054. Say '      After program ends the WPS will continue to resolve objects, also'
  1055. Say '      the building of the objects adds approx 100K to your OS2.INI.'
  1056. Say '';Say 'Press Y to add the folder to Desktop and populate...';Say '';
  1057. parse upper value SysGetKey('NOECHO') with key
  1058. If key<>'Y' Then Exit
  1059.  
  1060. /* Build folder for icons */
  1061. call charout ,'Building: ICONRESOURCE Icon Folder'
  1062. result = SysCreateObject('WPFolder', 'ICONRESOURCE^Icon Folder',,
  1063.         '<WP_DESKTOP>', 'OBJECTID=<ICN_FOLDER>;', 'R')
  1064. If result=1 Then call charout ,'...   Object created!'
  1065. Else             call charout ,'...   Not created! Return code='result
  1066. Say '';
  1067. classname='WPAbstract'
  1068. location='<ICN_FOLDER>'
  1069. /* WPCONFIG 1-13 WPPRTMRI 3-16 19-23 */
  1070. fn='PMWP'
  1071. Do i=1 to 75
  1072.    If i<5 | i=13 | (i>15 & i<21) | i=22 | (i>23 & i<30) | i=32 | i=33,
  1073.     | i=44 | i=46 | i=48 | i=52 | i=53 | (i>55 & i<73) Then Call BldObj
  1074. End
  1075. fn='WPCONFIG'
  1076. Do i=1 to 13
  1077.    Call BldObj
  1078. End
  1079. fn='WPPRTMRI'
  1080. Do i=3 to 23
  1081.    If (i<17 | i>18) Then Call BldObj
  1082. End
  1083. Say '';Say 'All done, to remove drag folder to shredder...'
  1084. Exit
  1085.  
  1086. /* Build Object */
  1087. BldObj:
  1088. if i<10 then j='0'||i
  1089. else j=i
  1090. title=fn'-'||j
  1091. setup='ICONRESOURCE='||j||' 'fn';OBJECTID=<ICN-'fn'-'||j||'>'
  1092. call charout ,'Building: 'title
  1093. result = SysCreateObject(classname, title, location, setup, 'R')
  1094. If result=1 Then call charout ,'...   Object created!'
  1095. Else             call charout ,'...   Not created! Return code='result
  1096. Say '';
  1097. Return
  1098.  
  1099. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1100. ((END REXX CMD SAMPLES))
  1101.  
  1102. ((BEGIN CODE FRAGMENTS))
  1103. - (SYSSET)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1104.  
  1105. System Settings
  1106. ===============
  1107. During our attempts at customizing the shell using REXXUTILs for newly created
  1108. workstations we discovered many items can be controlled. Our first attempt was
  1109. to turn off the default setting for Workplace Shell Print Screen. We wanted it
  1110. disabled instead of enabled (saves our customers from accidentally printing
  1111. the workplace shell screen contents :-)
  1112. From there we learned other items could be changed:
  1113.  
  1114. Remember the basic SysIni call is:
  1115.   result = SysIni([inifile], app, key, val)
  1116.  
  1117. Note: Some items if changed did not seem to take effect until the next reboot.
  1118.  
  1119. To see the menu items that can be changed go to:
  1120.  OS/2 System / System Setup / System, Window tab
  1121.  
  1122. Button appearance for windows
  1123. -----------------------------
  1124. /* Hide button = 1 plus hex 0 */
  1125. result = SysIni('USER', 'PM_ControlPanel', 'MinButtonType', '1'||'00'x)
  1126. /* Minimize button = 2 plus hex 0 */
  1127. result = SysIni('USER', 'PM_ControlPanel', 'MinButtonType', '2'||'00'x)
  1128.  
  1129. Animation
  1130. ---------
  1131. /* Enabled = hex 01 00 00 00 */
  1132. result = SysIni('USER', 'PM_ControlPanel', 'Animation', '01000000'x)
  1133. /* Disabled = hex 00 00 00 00 */
  1134. result = SysIni('USER', 'PM_ControlPanel', 'Animation', '00000000'x)
  1135.  
  1136. Minimize button behavior
  1137. ------------------------
  1138. /* Hide Window = 1 plus hex 0 */
  1139. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '1'||'00'x)
  1140. /* Minimize window to viewer = 2 plus hex 0 */
  1141. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '2'||'00'x)
  1142. /* Minimize window to desktop = 3 plus hex 0 */
  1143. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '3'||'00'x)
  1144.  
  1145. Object Open Behavior
  1146. --------------------
  1147. /* Display existing window; delete CCVIEW key */
  1148. result = SysIni('USER', 'PM_Workplace', 'CCVIEW', 'DELETE:')
  1149. /* Create new window; CCVIEW key set to 'ON' */
  1150. result = SysIni('USER', 'PM_Workplace', 'CCVIEW', 'ON'||'00'x)
  1151.  
  1152. To see the menu items that can be changed go to:
  1153.  OS/2 System / System Setup / System, Print Screen tab
  1154.  
  1155. Print Screen
  1156. ------------
  1157. /* Disable print screen */
  1158. result = SysIni('USER', 'PM_ControlPanel', 'PrintScreen', '0'||'00'x)
  1159. /* Enable print screen */
  1160. result = SysIni('USER', 'PM_ControlPanel', 'PrintScreen', '1'||'00'x)
  1161.  
  1162. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1163. ((END CODE FRAGMENTS))
  1164.  
  1165. END: REXXUTIL Information and Samples
  1166.