home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / info / faq / os2_20 / os2help / crtobj.fax < prev    next >
Encoding:
Text File  |  1992-09-17  |  46.9 KB  |  1,176 lines

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