home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 36 Tips / 36-Tips.zip / WPCTOJ.FAX < prev    next >
Text File  |  1994-11-25  |  45KB  |  1,172 lines

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